{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "6136cf0e",
   "metadata": {},
   "outputs": [],
   "source": [
    "import numpy as np"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "70389a06",
   "metadata": {},
   "outputs": [
    {
     "ename": "ModuleNotFoundError",
     "evalue": "No module named 'sklearn.liner_model'",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mModuleNotFoundError\u001b[0m                       Traceback (most recent call last)",
      "Cell \u001b[1;32mIn[2], line 1\u001b[0m\n\u001b[1;32m----> 1\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01msklearn\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01mliner_model\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m LinearRegression\n",
      "\u001b[1;31mModuleNotFoundError\u001b[0m: No module named 'sklearn.liner_model'"
     ]
    }
   ],
   "source": [
    "from sklearn.liner_model import LinearRegression"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "141699eb",
   "metadata": {},
   "outputs": [],
   "source": [
    "from sklearn.linear_model import LinearRegression"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "a14a9c6c",
   "metadata": {},
   "outputs": [],
   "source": [
    "from sklearn.metrics import mean_squared_error, r2_score"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "25e56db1",
   "metadata": {},
   "outputs": [],
   "source": [
    "import matplotlib.pyplot as plt"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "id": "34ed167d",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "真实参数: [ 2.  -1.   3.   1.5]\n",
      "估计的截距 (β0): 2.0564311456858584\n",
      "估计的系数 (β1-βp): [-1.03883164  2.97501822  1.44620334]\n",
      "\n",
      "均方误差 (MSE): 0.1892\n",
      "R²分数: 0.9833\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "D:\\miniconda3\\envs\\pydata-book\\lib\\site-packages\\IPython\\core\\pylabtools.py:152: UserWarning: Glyph 30446 (\\N{CJK UNIFIED IDEOGRAPH-76EE}) missing from current font.\n",
      "  fig.canvas.print_figure(bytes_io, **kw)\n",
      "D:\\miniconda3\\envs\\pydata-book\\lib\\site-packages\\IPython\\core\\pylabtools.py:152: UserWarning: Glyph 26631 (\\N{CJK UNIFIED IDEOGRAPH-6807}) missing from current font.\n",
      "  fig.canvas.print_figure(bytes_io, **kw)\n",
      "D:\\miniconda3\\envs\\pydata-book\\lib\\site-packages\\IPython\\core\\pylabtools.py:152: UserWarning: Glyph 21464 (\\N{CJK UNIFIED IDEOGRAPH-53D8}) missing from current font.\n",
      "  fig.canvas.print_figure(bytes_io, **kw)\n",
      "D:\\miniconda3\\envs\\pydata-book\\lib\\site-packages\\IPython\\core\\pylabtools.py:152: UserWarning: Glyph 37327 (\\N{CJK UNIFIED IDEOGRAPH-91CF}) missing from current font.\n",
      "  fig.canvas.print_figure(bytes_io, **kw)\n",
      "D:\\miniconda3\\envs\\pydata-book\\lib\\site-packages\\IPython\\core\\pylabtools.py:152: UserWarning: Glyph 32447 (\\N{CJK UNIFIED IDEOGRAPH-7EBF}) missing from current font.\n",
      "  fig.canvas.print_figure(bytes_io, **kw)\n",
      "D:\\miniconda3\\envs\\pydata-book\\lib\\site-packages\\IPython\\core\\pylabtools.py:152: UserWarning: Glyph 24615 (\\N{CJK UNIFIED IDEOGRAPH-6027}) missing from current font.\n",
      "  fig.canvas.print_figure(bytes_io, **kw)\n",
      "D:\\miniconda3\\envs\\pydata-book\\lib\\site-packages\\IPython\\core\\pylabtools.py:152: UserWarning: Glyph 22238 (\\N{CJK UNIFIED IDEOGRAPH-56DE}) missing from current font.\n",
      "  fig.canvas.print_figure(bytes_io, **kw)\n",
      "D:\\miniconda3\\envs\\pydata-book\\lib\\site-packages\\IPython\\core\\pylabtools.py:152: UserWarning: Glyph 24402 (\\N{CJK UNIFIED IDEOGRAPH-5F52}) missing from current font.\n",
      "  fig.canvas.print_figure(bytes_io, **kw)\n",
      "D:\\miniconda3\\envs\\pydata-book\\lib\\site-packages\\IPython\\core\\pylabtools.py:152: UserWarning: Glyph 25311 (\\N{CJK UNIFIED IDEOGRAPH-62DF}) missing from current font.\n",
      "  fig.canvas.print_figure(bytes_io, **kw)\n",
      "D:\\miniconda3\\envs\\pydata-book\\lib\\site-packages\\IPython\\core\\pylabtools.py:152: UserWarning: Glyph 21512 (\\N{CJK UNIFIED IDEOGRAPH-5408}) missing from current font.\n",
      "  fig.canvas.print_figure(bytes_io, **kw)\n",
      "D:\\miniconda3\\envs\\pydata-book\\lib\\site-packages\\IPython\\core\\pylabtools.py:152: UserWarning: Glyph 32467 (\\N{CJK UNIFIED IDEOGRAPH-7ED3}) missing from current font.\n",
      "  fig.canvas.print_figure(bytes_io, **kw)\n",
      "D:\\miniconda3\\envs\\pydata-book\\lib\\site-packages\\IPython\\core\\pylabtools.py:152: UserWarning: Glyph 26524 (\\N{CJK UNIFIED IDEOGRAPH-679C}) missing from current font.\n",
      "  fig.canvas.print_figure(bytes_io, **kw)\n",
      "D:\\miniconda3\\envs\\pydata-book\\lib\\site-packages\\IPython\\core\\pylabtools.py:152: UserWarning: Glyph 29305 (\\N{CJK UNIFIED IDEOGRAPH-7279}) missing from current font.\n",
      "  fig.canvas.print_figure(bytes_io, **kw)\n",
      "D:\\miniconda3\\envs\\pydata-book\\lib\\site-packages\\IPython\\core\\pylabtools.py:152: UserWarning: Glyph 24449 (\\N{CJK UNIFIED IDEOGRAPH-5F81}) missing from current font.\n",
      "  fig.canvas.print_figure(bytes_io, **kw)\n",
      "D:\\miniconda3\\envs\\pydata-book\\lib\\site-packages\\IPython\\core\\pylabtools.py:152: UserWarning: Glyph 30495 (\\N{CJK UNIFIED IDEOGRAPH-771F}) missing from current font.\n",
      "  fig.canvas.print_figure(bytes_io, **kw)\n",
      "D:\\miniconda3\\envs\\pydata-book\\lib\\site-packages\\IPython\\core\\pylabtools.py:152: UserWarning: Glyph 23454 (\\N{CJK UNIFIED IDEOGRAPH-5B9E}) missing from current font.\n",
      "  fig.canvas.print_figure(bytes_io, **kw)\n",
      "D:\\miniconda3\\envs\\pydata-book\\lib\\site-packages\\IPython\\core\\pylabtools.py:152: UserWarning: Glyph 25968 (\\N{CJK UNIFIED IDEOGRAPH-6570}) missing from current font.\n",
      "  fig.canvas.print_figure(bytes_io, **kw)\n",
      "D:\\miniconda3\\envs\\pydata-book\\lib\\site-packages\\IPython\\core\\pylabtools.py:152: UserWarning: Glyph 25454 (\\N{CJK UNIFIED IDEOGRAPH-636E}) missing from current font.\n",
      "  fig.canvas.print_figure(bytes_io, **kw)\n",
      "D:\\miniconda3\\envs\\pydata-book\\lib\\site-packages\\IPython\\core\\pylabtools.py:152: UserWarning: Glyph 39044 (\\N{CJK UNIFIED IDEOGRAPH-9884}) missing from current font.\n",
      "  fig.canvas.print_figure(bytes_io, **kw)\n",
      "D:\\miniconda3\\envs\\pydata-book\\lib\\site-packages\\IPython\\core\\pylabtools.py:152: UserWarning: Glyph 27979 (\\N{CJK UNIFIED IDEOGRAPH-6D4B}) missing from current font.\n",
      "  fig.canvas.print_figure(bytes_io, **kw)\n",
      "D:\\miniconda3\\envs\\pydata-book\\lib\\site-packages\\IPython\\core\\pylabtools.py:152: UserWarning: Glyph 20540 (\\N{CJK UNIFIED IDEOGRAPH-503C}) missing from current font.\n",
      "  fig.canvas.print_figure(bytes_io, **kw)\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAA1oAAAIhCAYAAABXMMsoAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjcuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/OQEPoAAAACXBIWXMAAA9hAAAPYQGoP6dpAACoN0lEQVR4nOzdeXhc5Xnw/++Zfd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2X+tqalJgUBAv/nNbyRJEyZM0JNPPqnly5ervLzcrlIBADYiaAEAMAIFBQX63e9+pw0bNui5555TKpXSLbfcooULF2r58uV2lwcAyBFMHQQAYIQuu+wy/fjHP9by5cv1la98RY2NjazBAgAMwIgWAABn4bvf/a4uuugiPfbYY1q/fr3KysrsLgkAkEMIWgAAnIXW1lbt3btXbrdb7777rt3lAAByDEELAICz8PWvf12zZ8/Wxo0bde+992r37t12lwQAyCGs0QIAYIQef/xxvfrqq3rzzTdVWVmpP//5z/rqV7+qf/3rX/3nbu3evVu9vb1qa2tTZ2dn/xbyl112mX2FAwCyhqAFAMAIvPPOO7rnnnv01FNPqbKyUpIVvC699FLdf//9evjhhyVJV199tZqbm/ufN2fOHEmSaZrZLxoAkHUELQAARqC6ulqxWGzAteLiYjU1NQ24duDAgSxWBQDINazRAgAAAIAMY0QLADBmBQIBvfDCC3rhhRdOuve5z31OkjRx4kTNmzdvyOe7XPw+EgBwdgyTyeIAAAAAkFH8qg4AAAAAMoygBQAAAAAZRtACAAAAgAwjaAEAAABAhhG0AAAAACDDCFoAAAAAkGEELQAAAADIMIIWAAAAAGTY/wc6ro9SzfJRngAAAABJRU5ErkJggg==",
      "text/plain": [
       "<Figure size 1000x600 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "# 示例数据: n个样本，p个特征\n",
    "np.random.seed(42)\n",
    "n = 100 # 样本数量\n",
    "p = 3 # 特征数量\n",
    "\n",
    "# 生成随机数据\n",
    "X = np.random.randn(n,p) # 特征矩阵 (n x p)\n",
    "true_beta = np.array([2, -1, 3, 1.5]) # 真实参数 [β0, β1, β2, β3]\n",
    "\n",
    "# 添加截距项（β0对应的常数项）\n",
    "X_with_intercept = np.column_stack([np.ones(n),X])\n",
    "\n",
    "# 生成目标变量（加入一些噪音）\n",
    "y = X_with_intercept @ true_beta + np.random.randn(n) * 0.5\n",
    "\n",
    "# 创建并训练线性回归模型\n",
    "model = LinearRegression(fit_intercept=True) # fit_intercept = True 会自动添加β0\n",
    "model.fit(X,y)\n",
    "\n",
    "# 获取估计的参数\n",
    "beta_hat_0 = model.intercept_ # β0的估计值\n",
    "beta_hat_j = model.coef_ # β1到βp的估计值\n",
    "\n",
    "print(\"真实参数:\", true_beta)\n",
    "print(\"估计的截距 (β0):\", beta_hat_0)\n",
    "print(\"估计的系数 (β1-βp):\", beta_hat_j)\n",
    "\n",
    "# 预测\n",
    "y_pred = model.predict(X)\n",
    "\n",
    "# 计算均方误差（MSE）和R²分数\n",
    "mse = mean_squared_error(y, y_pred)\n",
    "r2 = r2_score(y, y_pred)\n",
    "\n",
    "print(f\"\\n均方误差 (MSE): {mse:.4f}\")\n",
    "print(f\"R²分数: {r2:.4f}\")\n",
    "\n",
    "# 可视化结果（以第一个特征为例）\n",
    "plt.figure(figsize=(10, 6))\n",
    "plt.scatter(X[:, 0], y, alpha=0.7, label='真实数据')\n",
    "plt.scatter(X[:, 0], y_pred, alpha=0.7, label='预测值', color='red')\n",
    "plt.xlabel('特征 x1')\n",
    "plt.ylabel('目标变量 y')\n",
    "plt.title('线性回归拟合结果')\n",
    "plt.legend()\n",
    "plt.grid(True)\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "9aaa353a",
   "metadata": {},
   "outputs": [
    {
     "ename": "NameError",
     "evalue": "name 'X' is not defined",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mNameError\u001b[0m                                 Traceback (most recent call last)",
      "Cell \u001b[1;32mIn[2], line 1\u001b[0m\n\u001b[1;32m----> 1\u001b[0m np\u001b[38;5;241m.\u001b[39mones(\u001b[43mX\u001b[49m\u001b[38;5;241m.\u001b[39mshape[\u001b[38;5;241m0\u001b[39m])\n",
      "\u001b[1;31mNameError\u001b[0m: name 'X' is not defined"
     ]
    }
   ],
   "source": [
    "np.ones(X.shape[0])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "23d9ae62",
   "metadata": {},
   "outputs": [
    {
     "ename": "NameError",
     "evalue": "name 'n' is not defined",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mNameError\u001b[0m                                 Traceback (most recent call last)",
      "Cell \u001b[1;32mIn[3], line 1\u001b[0m\n\u001b[1;32m----> 1\u001b[0m X \u001b[38;5;241m=\u001b[39m np\u001b[38;5;241m.\u001b[39mrandom\u001b[38;5;241m.\u001b[39mrandn(\u001b[43mn\u001b[49m,p) \u001b[38;5;66;03m# 特征矩阵 (n x p)\u001b[39;00m\n",
      "\u001b[1;31mNameError\u001b[0m: name 'n' is not defined"
     ]
    }
   ],
   "source": [
    "X = np.random.randn(n,p) # 特征矩阵 (n x p)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "6b0384b4",
   "metadata": {},
   "outputs": [
    {
     "ename": "NameError",
     "evalue": "name 'n' is not defined",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mNameError\u001b[0m                                 Traceback (most recent call last)",
      "Cell \u001b[1;32mIn[4], line 1\u001b[0m\n\u001b[1;32m----> 1\u001b[0m X \u001b[38;5;241m=\u001b[39m np\u001b[38;5;241m.\u001b[39mrandom\u001b[38;5;241m.\u001b[39mrandn(\u001b[43mn\u001b[49m,p) \u001b[38;5;66;03m# 特征矩阵 (n x p)\u001b[39;00m\n\u001b[0;32m      2\u001b[0m np\u001b[38;5;241m.\u001b[39mones(X\u001b[38;5;241m.\u001b[39mshape[\u001b[38;5;241m0\u001b[39m])\n",
      "\u001b[1;31mNameError\u001b[0m: name 'n' is not defined"
     ]
    }
   ],
   "source": [
    "X = np.random.randn(n,p) # 特征矩阵 (n x p)\n",
    "np.ones(X.shape[0])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "98e4c79a",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([1., 1., 1., 1., 1., 1., 1., 1., 1., 1.])"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "X = np.random.randn(10,3) # 特征矩阵 (n x p)\n",
    "np.ones(X.shape[0])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "48f40b9f",
   "metadata": {},
   "outputs": [],
   "source": [
    "X = np.random.randn(10,3) # 特征矩阵 (n x p)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "id": "644b2f14",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[-1.06175547, -1.15175227,  0.39486507],\n",
       "       [-1.19531435, -1.48922375,  1.02752321],\n",
       "       [-0.43775546,  2.09626094, -0.26523424],\n",
       "       [ 0.31205261, -0.24056586, -1.36397587],\n",
       "       [ 0.50638442,  2.60387561, -0.64477567],\n",
       "       [-0.8236229 , -0.81732696, -0.97035585],\n",
       "       [-1.82317758,  0.39322183, -0.12734736],\n",
       "       [-0.09526501,  0.65714932,  0.26383796],\n",
       "       [ 0.44742219,  0.79939144, -0.55522519],\n",
       "       [ 1.4586149 ,  0.95397279,  1.22636539]])"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "X"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "id": "41a194c3",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "10"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "X.shape[0]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "id": "9bc952b6",
   "metadata": {},
   "outputs": [
    {
     "ename": "TypeError",
     "evalue": "'tuple' object is not callable",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mTypeError\u001b[0m                                 Traceback (most recent call last)",
      "Cell \u001b[1;32mIn[9], line 1\u001b[0m\n\u001b[1;32m----> 1\u001b[0m \u001b[43mX\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mshape\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n",
      "\u001b[1;31mTypeError\u001b[0m: 'tuple' object is not callable"
     ]
    }
   ],
   "source": [
    "X.shape()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "id": "7a0509d8",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(10, 3)"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "X.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "id": "a9592b30",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([1., 1., 1., 1., 1., 1., 1., 1., 1., 1.])"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "np.ones(X.shape[0])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "d38e9dfb",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "d9aeacc3",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "6c328326",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "19c40335",
   "metadata": {},
   "outputs": [],
   "source": [
    "import numpy as np"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "id": "f5147872",
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd    "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "id": "4eb4232f",
   "metadata": {},
   "outputs": [],
   "source": [
    "df = pd.read_csv('examples/Table-8.1.csv')\n",
    "x = df['Weight (kg)'].values\n",
    "y = df['Height (cm)'].values"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "id": "1cc2834b",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(array([ 77, 110,  70,  85,  65,  75,  75,  63,  55,  66,  95,  72,  83,\n",
       "        115], dtype=int64),\n",
       " array([175, 195, 172, 180, 168, 173, 180, 165, 158, 163, 190, 172, 185,\n",
       "        192], dtype=int64))"
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "x,y"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "id": "369c9fdd",
   "metadata": {},
   "outputs": [],
   "source": [
    "def least_squares_loss(beta0, beta1, x, y):\n",
    "    y_pred = beta0 + beta1 * x\n",
    "    errors = y - y_pred\n",
    "    return np.sum(errors ** 2)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "id": "38952b1b",
   "metadata": {},
   "outputs": [],
   "source": [
    "# Example: compute loss for beta0 = 0 beta1=1\n",
    "loss = least_squares_loss(0, 1, x, y)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "id": "a9ef3604",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "133276"
      ]
     },
     "execution_count": 17,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "loss"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "id": "6e85f2a8",
   "metadata": {
    "collapsed": true
   },
   "outputs": [
    {
     "ename": "TypeError",
     "evalue": "unsupported format string passed to numpy.ndarray.__format__",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mTypeError\u001b[0m                                 Traceback (most recent call last)",
      "Cell \u001b[1;32mIn[18], line 5\u001b[0m\n\u001b[0;32m      3\u001b[0m beta1 \u001b[38;5;241m=\u001b[39m (np\u001b[38;5;241m.\u001b[39msum(x \u001b[38;5;241m-\u001b[39m x_mean) \u001b[38;5;241m*\u001b[39m (y \u001b[38;5;241m-\u001b[39m y_mean)) \u001b[38;5;241m/\u001b[39m np\u001b[38;5;241m.\u001b[39msum((x \u001b[38;5;241m-\u001b[39m x_mean) \u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39m \u001b[38;5;241m2\u001b[39m)\n\u001b[0;32m      4\u001b[0m beta0 \u001b[38;5;241m=\u001b[39m y_mean \u001b[38;5;241m-\u001b[39m beta1 \u001b[38;5;241m*\u001b[39m x_mean\n\u001b[1;32m----> 5\u001b[0m \u001b[38;5;28mprint\u001b[39m(\u001b[38;5;124mf\u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mOptimal beta0: \u001b[39m\u001b[38;5;132;01m{\u001b[39;00mbeta0\u001b[38;5;132;01m:\u001b[39;00m\u001b[38;5;124m.3f\u001b[39m\u001b[38;5;132;01m}\u001b[39;00m\u001b[38;5;124m, beta1: \u001b[39m\u001b[38;5;132;01m{\u001b[39;00mbeta1\u001b[38;5;132;01m:\u001b[39;00m\u001b[38;5;124m.3f\u001b[39m\u001b[38;5;132;01m}\u001b[39;00m\u001b[38;5;124m\"\u001b[39m)\n",
      "\u001b[1;31mTypeError\u001b[0m: unsupported format string passed to numpy.ndarray.__format__"
     ]
    }
   ],
   "source": [
    "# closed-form solution\n",
    "x_mean, y_mean = np.mean(x), np.mean(y)\n",
    "beta1 = (np.sum(x - x_mean) * (y - y_mean)) / np.sum((x - x_mean) ** 2)\n",
    "beta0 = y_mean - beta1 * x_mean\n",
    "print(f\"Optimal beta0: {beta0:.3f}, beta1: {beta1:.3f}\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "03f0bf42",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "id": "e85e24bd",
   "metadata": {
    "collapsed": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Optimal beta0: [176.28571429 176.28571429 176.28571429 176.28571429 176.28571429\n",
      " 176.28571429 176.28571429 176.28571429 176.28571429 176.28571429\n",
      " 176.28571429 176.28571429 176.28571429 176.28571429], beta1: [-0.  0. -0.  0. -0. -0.  0. -0. -0. -0.  0. -0.  0.  0.]\n"
     ]
    }
   ],
   "source": [
    "# closed-form solution\n",
    "x_mean, y_mean = np.mean(x), np.mean(y)\n",
    "beta1 = (np.sum(x - x_mean) * (y - y_mean)) / np.sum((x - x_mean) ** 2)\n",
    "beta0 = y_mean - beta1 * x_mean\n",
    "print(f\"Optimal beta0: {beta0}, beta1: {beta1}\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "id": "2650ac61",
   "metadata": {
    "collapsed": true
   },
   "outputs": [
    {
     "ename": "NameError",
     "evalue": "name 'beat1' is not defined",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mNameError\u001b[0m                                 Traceback (most recent call last)",
      "Cell \u001b[1;32mIn[20], line 1\u001b[0m\n\u001b[1;32m----> 1\u001b[0m \u001b[43mbeat1\u001b[49m\n",
      "\u001b[1;31mNameError\u001b[0m: name 'beat1' is not defined"
     ]
    }
   ],
   "source": [
    "beat1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "id": "2d5e5c8e",
   "metadata": {
    "collapsed": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([-0.,  0., -0.,  0., -0., -0.,  0., -0., -0., -0.,  0., -0.,  0.,\n",
       "        0.])"
      ]
     },
     "execution_count": 21,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "beta1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "id": "5e24d8d7",
   "metadata": {
    "collapsed": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(array([ 77, 110,  70,  85,  65,  75,  75,  63,  55,  66,  95,  72,  83,\n",
       "        115], dtype=int64),\n",
       " array([175, 195, 172, 180, 168, 173, 180, 165, 158, 163, 190, 172, 185,\n",
       "        192], dtype=int64))"
      ]
     },
     "execution_count": 22,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "x,y"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "id": "3a63e22d",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Optimal beta0: 128.01687518184463, beta1: 0.6109979633401222\n"
     ]
    }
   ],
   "source": [
    "# closed-form solution\n",
    "x_mean, y_mean = np.mean(x), np.mean(y)\n",
    "beta1 = np.sum((x - x_mean) * (y - y_mean)) / np.sum((x - x_mean) ** 2)\n",
    "beta0 = y_mean - beta1 * x_mean\n",
    "print(f\"Optimal beta0: {beta0}, beta1: {beta1}\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "id": "99a23eb5",
   "metadata": {},
   "outputs": [],
   "source": [
    "# verify final loss\n",
    "optimal_loss = least_squares_loss(beta0, beta1, x, y)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "id": "4aa31c5f",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "178.4620308408497"
      ]
     },
     "execution_count": 25,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "optimal_loss"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "id": "0317a930",
   "metadata": {},
   "outputs": [],
   "source": [
    "def arg_min(beta0, beta1, x, y):\n",
    "    y_pred = beta0 + beta1 * x\n",
    "    error = y - y_pred\n",
    "    return np.sum(error ** 2)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "id": "a970ee0c",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "178.4620308408497"
      ]
     },
     "execution_count": 27,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "arg_min(beta0, beta1, x, y)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "id": "b1ff609b",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(array([ 77, 110,  70,  85,  65,  75,  75,  63,  55,  66,  95,  72,  83,\n",
       "        115], dtype=int64),\n",
       " array([175, 195, 172, 180, 168, 173, 180, 165, 158, 163, 190, 172, 185,\n",
       "        192], dtype=int64))"
      ]
     },
     "execution_count": 28,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "x,y"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "id": "168529be",
   "metadata": {},
   "outputs": [],
   "source": [
    "# shape(10,3)\n",
    "n = 10\n",
    "p = 3\n",
    "\n",
    "X = np.random.rand(n,p)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "id": "dcd2c18e",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[0.7347438 , 0.70272886, 0.8378895 ],\n",
       "       [0.79785263, 0.03841998, 0.77961347],\n",
       "       [0.73088416, 0.63839755, 0.18769355],\n",
       "       [0.89191005, 0.22477676, 0.02350276],\n",
       "       [0.043561  , 0.36676305, 0.97828553],\n",
       "       [0.73217525, 0.1458404 , 0.02514439],\n",
       "       [0.18442027, 0.43980558, 0.22465773],\n",
       "       [0.07118199, 0.45415303, 0.89180848],\n",
       "       [0.88685209, 0.98491938, 0.98908848],\n",
       "       [0.73250589, 0.96332463, 0.07288155]])"
      ]
     },
     "execution_count": 30,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "X"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 31,
   "id": "17db7beb",
   "metadata": {},
   "outputs": [],
   "source": [
    "X_with_intercept = np.column_stack([np.ones(n),X])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 32,
   "id": "7828945e",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[1.        , 0.7347438 , 0.70272886, 0.8378895 ],\n",
       "       [1.        , 0.79785263, 0.03841998, 0.77961347],\n",
       "       [1.        , 0.73088416, 0.63839755, 0.18769355],\n",
       "       [1.        , 0.89191005, 0.22477676, 0.02350276],\n",
       "       [1.        , 0.043561  , 0.36676305, 0.97828553],\n",
       "       [1.        , 0.73217525, 0.1458404 , 0.02514439],\n",
       "       [1.        , 0.18442027, 0.43980558, 0.22465773],\n",
       "       [1.        , 0.07118199, 0.45415303, 0.89180848],\n",
       "       [1.        , 0.88685209, 0.98491938, 0.98908848],\n",
       "       [1.        , 0.73250589, 0.96332463, 0.07288155]])"
      ]
     },
     "execution_count": 32,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "X_with_intercept"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 33,
   "id": "2cf49105",
   "metadata": {},
   "outputs": [],
   "source": [
    "true_beta = np.array([2, -1, 3])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 34,
   "id": "36ffd896",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[0.7347438 , 0.70272886, 0.8378895 ],\n",
       "       [0.79785263, 0.03841998, 0.77961347],\n",
       "       [0.73088416, 0.63839755, 0.18769355],\n",
       "       [0.89191005, 0.22477676, 0.02350276],\n",
       "       [0.043561  , 0.36676305, 0.97828553],\n",
       "       [0.73217525, 0.1458404 , 0.02514439],\n",
       "       [0.18442027, 0.43980558, 0.22465773],\n",
       "       [0.07118199, 0.45415303, 0.89180848],\n",
       "       [0.88685209, 0.98491938, 0.98908848],\n",
       "       [0.73250589, 0.96332463, 0.07288155]])"
      ]
     },
     "execution_count": 34,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "X"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 35,
   "id": "95e81a07",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[1.        , 0.7347438 , 0.70272886, 0.8378895 ],\n",
       "       [1.        , 0.79785263, 0.03841998, 0.77961347],\n",
       "       [1.        , 0.73088416, 0.63839755, 0.18769355],\n",
       "       [1.        , 0.89191005, 0.22477676, 0.02350276],\n",
       "       [1.        , 0.043561  , 0.36676305, 0.97828553],\n",
       "       [1.        , 0.73217525, 0.1458404 , 0.02514439],\n",
       "       [1.        , 0.18442027, 0.43980558, 0.22465773],\n",
       "       [1.        , 0.07118199, 0.45415303, 0.89180848],\n",
       "       [1.        , 0.88685209, 0.98491938, 0.98908848],\n",
       "       [1.        , 0.73250589, 0.96332463, 0.07288155]])"
      ]
     },
     "execution_count": 35,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "X_with_intercept"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 36,
   "id": "791a4b9c",
   "metadata": {},
   "outputs": [
    {
     "ename": "TypeError",
     "evalue": "array() takes from 1 to 2 positional arguments but 3 were given",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mTypeError\u001b[0m                                 Traceback (most recent call last)",
      "Cell \u001b[1;32mIn[36], line 1\u001b[0m\n\u001b[1;32m----> 1\u001b[0m X \u001b[38;5;241m=\u001b[39m \u001b[43mnp\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43marray\u001b[49m\u001b[43m(\u001b[49m\n\u001b[0;32m      2\u001b[0m \u001b[43m    \u001b[49m\u001b[43m[\u001b[49m\u001b[38;5;241;43m1\u001b[39;49m\u001b[43m,\u001b[49m\u001b[38;5;241;43m2\u001b[39;49m\u001b[43m]\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m      3\u001b[0m \u001b[43m    \u001b[49m\u001b[43m[\u001b[49m\u001b[38;5;241;43m2\u001b[39;49m\u001b[43m,\u001b[49m\u001b[38;5;241;43m3\u001b[39;49m\u001b[43m]\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m      4\u001b[0m \u001b[43m    \u001b[49m\u001b[43m[\u001b[49m\u001b[38;5;241;43m3\u001b[39;49m\u001b[43m,\u001b[49m\u001b[38;5;241;43m4\u001b[39;49m\u001b[43m]\u001b[49m\n\u001b[0;32m      5\u001b[0m \u001b[43m)\u001b[49m\n",
      "\u001b[1;31mTypeError\u001b[0m: array() takes from 1 to 2 positional arguments but 3 were given"
     ]
    }
   ],
   "source": [
    "X = np.array(\n",
    "    [1,2],\n",
    "    [2,3],\n",
    "    [3,4]\n",
    ")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 37,
   "id": "6e4c81b8",
   "metadata": {},
   "outputs": [],
   "source": [
    "X = np.array([\n",
    "    [1,2],\n",
    "    [2,3],\n",
    "    [3,4]\n",
    "], dtype = float)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 38,
   "id": "e0b8b5cb",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[1., 2.],\n",
       "       [2., 3.],\n",
       "       [3., 4.]])"
      ]
     },
     "execution_count": 38,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "X"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 39,
   "id": "cd04f5aa",
   "metadata": {},
   "outputs": [],
   "source": [
    "y = np.array([4,8,10], dtype =float)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 40,
   "id": "14839bb1",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([ 4.,  8., 10.])"
      ]
     },
     "execution_count": 40,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "y"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 41,
   "id": "122fcf88",
   "metadata": {
    "collapsed": true
   },
   "outputs": [
    {
     "ename": "AttributeError",
     "evalue": "module 'numpy' has no attribute 'stack_column'",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mAttributeError\u001b[0m                            Traceback (most recent call last)",
      "Cell \u001b[1;32mIn[41], line 2\u001b[0m\n\u001b[0;32m      1\u001b[0m \u001b[38;5;66;03m# Add intercept column\u001b[39;00m\n\u001b[1;32m----> 2\u001b[0m X_b \u001b[38;5;241m=\u001b[39m \u001b[43mnp\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mstack_column\u001b[49m(np\u001b[38;5;241m.\u001b[39mones(X\u001b[38;5;241m.\u001b[39mshape(\u001b[38;5;241m0\u001b[39m)),X)\n",
      "File \u001b[1;32mD:\\miniconda3\\envs\\pydata-book\\lib\\site-packages\\numpy\\__init__.py:320\u001b[0m, in \u001b[0;36m__getattr__\u001b[1;34m(attr)\u001b[0m\n\u001b[0;32m    317\u001b[0m     \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01mtesting\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m Tester\n\u001b[0;32m    318\u001b[0m     \u001b[38;5;28;01mreturn\u001b[39;00m Tester\n\u001b[1;32m--> 320\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;167;01mAttributeError\u001b[39;00m(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mmodule \u001b[39m\u001b[38;5;132;01m{!r}\u001b[39;00m\u001b[38;5;124m has no attribute \u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[0;32m    321\u001b[0m                      \u001b[38;5;124m\"\u001b[39m\u001b[38;5;132;01m{!r}\u001b[39;00m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;241m.\u001b[39mformat(\u001b[38;5;18m__name__\u001b[39m, attr))\n",
      "\u001b[1;31mAttributeError\u001b[0m: module 'numpy' has no attribute 'stack_column'"
     ]
    }
   ],
   "source": [
    "# Add intercept column\n",
    "X_b = np.stack_column(np.ones(X.shape(0)),X)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 42,
   "id": "de4df146",
   "metadata": {
    "collapsed": true
   },
   "outputs": [
    {
     "ename": "AttributeError",
     "evalue": "module 'numpy' has no attribute 'stack_columnS'",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mAttributeError\u001b[0m                            Traceback (most recent call last)",
      "Cell \u001b[1;32mIn[42], line 2\u001b[0m\n\u001b[0;32m      1\u001b[0m \u001b[38;5;66;03m# Add intercept column\u001b[39;00m\n\u001b[1;32m----> 2\u001b[0m X_b \u001b[38;5;241m=\u001b[39m \u001b[43mnp\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mstack_columnS\u001b[49m(np\u001b[38;5;241m.\u001b[39mones(X\u001b[38;5;241m.\u001b[39mshape(\u001b[38;5;241m0\u001b[39m)),X)\n",
      "File \u001b[1;32mD:\\miniconda3\\envs\\pydata-book\\lib\\site-packages\\numpy\\__init__.py:320\u001b[0m, in \u001b[0;36m__getattr__\u001b[1;34m(attr)\u001b[0m\n\u001b[0;32m    317\u001b[0m     \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01mtesting\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m Tester\n\u001b[0;32m    318\u001b[0m     \u001b[38;5;28;01mreturn\u001b[39;00m Tester\n\u001b[1;32m--> 320\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;167;01mAttributeError\u001b[39;00m(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mmodule \u001b[39m\u001b[38;5;132;01m{!r}\u001b[39;00m\u001b[38;5;124m has no attribute \u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[0;32m    321\u001b[0m                      \u001b[38;5;124m\"\u001b[39m\u001b[38;5;132;01m{!r}\u001b[39;00m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;241m.\u001b[39mformat(\u001b[38;5;18m__name__\u001b[39m, attr))\n",
      "\u001b[1;31mAttributeError\u001b[0m: module 'numpy' has no attribute 'stack_columnS'"
     ]
    }
   ],
   "source": [
    "# Add intercept column\n",
    "X_b = np.stack_columnS(np.ones(X.shape(0)),X)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 43,
   "id": "9275b04c",
   "metadata": {
    "collapsed": true
   },
   "outputs": [
    {
     "ename": "AttributeError",
     "evalue": "module 'numpy' has no attribute 'stack_columns'",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mAttributeError\u001b[0m                            Traceback (most recent call last)",
      "Cell \u001b[1;32mIn[43], line 2\u001b[0m\n\u001b[0;32m      1\u001b[0m \u001b[38;5;66;03m# Add intercept column\u001b[39;00m\n\u001b[1;32m----> 2\u001b[0m X_b \u001b[38;5;241m=\u001b[39m \u001b[43mnp\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mstack_columns\u001b[49m([np\u001b[38;5;241m.\u001b[39mones(X\u001b[38;5;241m.\u001b[39mshape(\u001b[38;5;241m0\u001b[39m)),X])\n",
      "File \u001b[1;32mD:\\miniconda3\\envs\\pydata-book\\lib\\site-packages\\numpy\\__init__.py:320\u001b[0m, in \u001b[0;36m__getattr__\u001b[1;34m(attr)\u001b[0m\n\u001b[0;32m    317\u001b[0m     \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01mtesting\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m Tester\n\u001b[0;32m    318\u001b[0m     \u001b[38;5;28;01mreturn\u001b[39;00m Tester\n\u001b[1;32m--> 320\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;167;01mAttributeError\u001b[39;00m(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mmodule \u001b[39m\u001b[38;5;132;01m{!r}\u001b[39;00m\u001b[38;5;124m has no attribute \u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[0;32m    321\u001b[0m                      \u001b[38;5;124m\"\u001b[39m\u001b[38;5;132;01m{!r}\u001b[39;00m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;241m.\u001b[39mformat(\u001b[38;5;18m__name__\u001b[39m, attr))\n",
      "\u001b[1;31mAttributeError\u001b[0m: module 'numpy' has no attribute 'stack_columns'"
     ]
    }
   ],
   "source": [
    "# Add intercept column\n",
    "X_b = np.stack_columns([np.ones(X.shape(0)),X])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 44,
   "id": "58893b35",
   "metadata": {
    "collapsed": true
   },
   "outputs": [
    {
     "ename": "AttributeError",
     "evalue": "module 'numpy' has no attribute 'stack_column'",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mAttributeError\u001b[0m                            Traceback (most recent call last)",
      "Cell \u001b[1;32mIn[44], line 2\u001b[0m\n\u001b[0;32m      1\u001b[0m \u001b[38;5;66;03m# Add intercept column\u001b[39;00m\n\u001b[1;32m----> 2\u001b[0m X_b \u001b[38;5;241m=\u001b[39m \u001b[43mnp\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mstack_column\u001b[49m(\n\u001b[0;32m      3\u001b[0m     (np\u001b[38;5;241m.\u001b[39mones(X\u001b[38;5;241m.\u001b[39mshape(\u001b[38;5;241m0\u001b[39m)),X)\n\u001b[0;32m      4\u001b[0m )\n",
      "File \u001b[1;32mD:\\miniconda3\\envs\\pydata-book\\lib\\site-packages\\numpy\\__init__.py:320\u001b[0m, in \u001b[0;36m__getattr__\u001b[1;34m(attr)\u001b[0m\n\u001b[0;32m    317\u001b[0m     \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01mtesting\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m Tester\n\u001b[0;32m    318\u001b[0m     \u001b[38;5;28;01mreturn\u001b[39;00m Tester\n\u001b[1;32m--> 320\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;167;01mAttributeError\u001b[39;00m(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mmodule \u001b[39m\u001b[38;5;132;01m{!r}\u001b[39;00m\u001b[38;5;124m has no attribute \u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[0;32m    321\u001b[0m                      \u001b[38;5;124m\"\u001b[39m\u001b[38;5;132;01m{!r}\u001b[39;00m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;241m.\u001b[39mformat(\u001b[38;5;18m__name__\u001b[39m, attr))\n",
      "\u001b[1;31mAttributeError\u001b[0m: module 'numpy' has no attribute 'stack_column'"
     ]
    }
   ],
   "source": [
    "# Add intercept column\n",
    "X_b = np.stack_column(\n",
    "    (np.ones(X.shape(0)),X)\n",
    ")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 45,
   "id": "f0fc046b",
   "metadata": {
    "collapsed": true
   },
   "outputs": [
    {
     "ename": "TypeError",
     "evalue": "'tuple' object is not callable",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mTypeError\u001b[0m                                 Traceback (most recent call last)",
      "Cell \u001b[1;32mIn[45], line 3\u001b[0m\n\u001b[0;32m      1\u001b[0m \u001b[38;5;66;03m# Add intercept column\u001b[39;00m\n\u001b[0;32m      2\u001b[0m X_b \u001b[38;5;241m=\u001b[39m np\u001b[38;5;241m.\u001b[39mcolumn_stack(\n\u001b[1;32m----> 3\u001b[0m     (np\u001b[38;5;241m.\u001b[39mones(\u001b[43mX\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mshape\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;241;43m0\u001b[39;49m\u001b[43m)\u001b[49m),X)\n\u001b[0;32m      4\u001b[0m )\n",
      "\u001b[1;31mTypeError\u001b[0m: 'tuple' object is not callable"
     ]
    }
   ],
   "source": [
    "# Add intercept column\n",
    "X_b = np.column_stack(\n",
    "    (np.ones(X.shape(0)),X)\n",
    ")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 46,
   "id": "ad3a9fa2",
   "metadata": {},
   "outputs": [
    {
     "ename": "SyntaxError",
     "evalue": "unexpected EOF while parsing (1248890043.py, line 4)",
     "output_type": "error",
     "traceback": [
      "\u001b[1;36m  Cell \u001b[1;32mIn[46], line 4\u001b[1;36m\u001b[0m\n\u001b[1;33m    )\u001b[0m\n\u001b[1;37m     ^\u001b[0m\n\u001b[1;31mSyntaxError\u001b[0m\u001b[1;31m:\u001b[0m unexpected EOF while parsing\n"
     ]
    }
   ],
   "source": [
    "# Add intercept column\n",
    "X_b = np.column_stack(\n",
    "    (np.ones(X.shape[0],X)\n",
    ")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 47,
   "id": "cf76b28e",
   "metadata": {
    "collapsed": true
   },
   "outputs": [
    {
     "ename": "TypeError",
     "evalue": "column_stack() takes 1 positional argument but 2 were given",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mTypeError\u001b[0m                                 Traceback (most recent call last)",
      "Cell \u001b[1;32mIn[47], line 2\u001b[0m\n\u001b[0;32m      1\u001b[0m \u001b[38;5;66;03m# Add intercept column\u001b[39;00m\n\u001b[1;32m----> 2\u001b[0m X_b \u001b[38;5;241m=\u001b[39m \u001b[43mnp\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mcolumn_stack\u001b[49m\u001b[43m(\u001b[49m\n\u001b[0;32m      3\u001b[0m \u001b[43m    \u001b[49m\u001b[43mnp\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mones\u001b[49m\u001b[43m(\u001b[49m\u001b[43mX\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mshape\u001b[49m\u001b[43m[\u001b[49m\u001b[38;5;241;43m0\u001b[39;49m\u001b[43m]\u001b[49m\u001b[43m)\u001b[49m\u001b[43m,\u001b[49m\u001b[43mX\u001b[49m\n\u001b[0;32m      4\u001b[0m \u001b[43m)\u001b[49m\n",
      "File \u001b[1;32m<__array_function__ internals>:198\u001b[0m, in \u001b[0;36mcolumn_stack\u001b[1;34m(*args, **kwargs)\u001b[0m\n",
      "\u001b[1;31mTypeError\u001b[0m: column_stack() takes 1 positional argument but 2 were given"
     ]
    }
   ],
   "source": [
    "# Add intercept column\n",
    "X_b = np.column_stack(\n",
    "    np.ones(X.shape[0]),X\n",
    ")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 48,
   "id": "35f68d02",
   "metadata": {},
   "outputs": [],
   "source": [
    "# Add intercept column\n",
    "X_b = np.column_stack(\n",
    "    (np.ones(X.shape[0]),X)\n",
    ")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 49,
   "id": "9fb12ea3",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[1., 1., 2.],\n",
       "       [1., 2., 3.],\n",
       "       [1., 3., 4.]])"
      ]
     },
     "execution_count": 49,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "X_b"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 50,
   "id": "86c6a7bb",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[1., 2.],\n",
       "       [2., 3.],\n",
       "       [3., 4.]])"
      ]
     },
     "execution_count": 50,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "X"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 51,
   "id": "ee732b91",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([ 0.45036872, -1.1197245 ,  1.07136939,  0.45297138, -0.02733042,\n",
       "       -0.34623713, -0.11512282, -0.61423839, -1.27623894,  1.35310716])"
      ]
     },
     "execution_count": 51,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "np.random.randn(10)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 52,
   "id": "9eff751d",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[1., 2.],\n",
       "       [2., 3.],\n",
       "       [3., 4.]])"
      ]
     },
     "execution_count": 52,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "X"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 53,
   "id": "bdd12a04",
   "metadata": {
    "collapsed": true
   },
   "outputs": [
    {
     "ename": "NameError",
     "evalue": "name 'Y' is not defined",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mNameError\u001b[0m                                 Traceback (most recent call last)",
      "Cell \u001b[1;32mIn[53], line 1\u001b[0m\n\u001b[1;32m----> 1\u001b[0m \u001b[43mY\u001b[49m\n",
      "\u001b[1;31mNameError\u001b[0m: name 'Y' is not defined"
     ]
    }
   ],
   "source": [
    "Y"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 54,
   "id": "bc1482bb",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([ 4.,  8., 10.])"
      ]
     },
     "execution_count": 54,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "y"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 55,
   "id": "420bfe49",
   "metadata": {},
   "outputs": [
    {
     "ename": "AttributeError",
     "evalue": "module 'numpy' has no attribute 'stack_column'",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mAttributeError\u001b[0m                            Traceback (most recent call last)",
      "Cell \u001b[1;32mIn[55], line 2\u001b[0m\n\u001b[0;32m      1\u001b[0m \u001b[38;5;66;03m# Add intercept column\u001b[39;00m\n\u001b[1;32m----> 2\u001b[0m X_b \u001b[38;5;241m=\u001b[39m \u001b[43mnp\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mstack_column\u001b[49m(\n\u001b[0;32m      3\u001b[0m     np\u001b[38;5;241m.\u001b[39mones(x\u001b[38;5;241m.\u001b[39mshape[\u001b[38;5;241m0\u001b[39m]),X\n\u001b[0;32m      4\u001b[0m )\n",
      "File \u001b[1;32mD:\\miniconda3\\envs\\pydata-book\\lib\\site-packages\\numpy\\__init__.py:320\u001b[0m, in \u001b[0;36m__getattr__\u001b[1;34m(attr)\u001b[0m\n\u001b[0;32m    317\u001b[0m     \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01mtesting\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m Tester\n\u001b[0;32m    318\u001b[0m     \u001b[38;5;28;01mreturn\u001b[39;00m Tester\n\u001b[1;32m--> 320\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;167;01mAttributeError\u001b[39;00m(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mmodule \u001b[39m\u001b[38;5;132;01m{!r}\u001b[39;00m\u001b[38;5;124m has no attribute \u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[0;32m    321\u001b[0m                      \u001b[38;5;124m\"\u001b[39m\u001b[38;5;132;01m{!r}\u001b[39;00m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;241m.\u001b[39mformat(\u001b[38;5;18m__name__\u001b[39m, attr))\n",
      "\u001b[1;31mAttributeError\u001b[0m: module 'numpy' has no attribute 'stack_column'"
     ]
    }
   ],
   "source": [
    "C"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 56,
   "id": "98f63ac7",
   "metadata": {},
   "outputs": [
    {
     "ename": "TypeError",
     "evalue": "column_stack() takes 1 positional argument but 2 were given",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mTypeError\u001b[0m                                 Traceback (most recent call last)",
      "Cell \u001b[1;32mIn[56], line 2\u001b[0m\n\u001b[0;32m      1\u001b[0m \u001b[38;5;66;03m# Add intercept column\u001b[39;00m\n\u001b[1;32m----> 2\u001b[0m X_b \u001b[38;5;241m=\u001b[39m \u001b[43mnp\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mcolumn_stack\u001b[49m\u001b[43m(\u001b[49m\n\u001b[0;32m      3\u001b[0m \u001b[43m    \u001b[49m\u001b[43mnp\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mones\u001b[49m\u001b[43m(\u001b[49m\u001b[43mx\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mshape\u001b[49m\u001b[43m[\u001b[49m\u001b[38;5;241;43m0\u001b[39;49m\u001b[43m]\u001b[49m\u001b[43m)\u001b[49m\u001b[43m,\u001b[49m\u001b[43mX\u001b[49m\n\u001b[0;32m      4\u001b[0m \u001b[43m)\u001b[49m\n",
      "File \u001b[1;32m<__array_function__ internals>:198\u001b[0m, in \u001b[0;36mcolumn_stack\u001b[1;34m(*args, **kwargs)\u001b[0m\n",
      "\u001b[1;31mTypeError\u001b[0m: column_stack() takes 1 positional argument but 2 were given"
     ]
    }
   ],
   "source": [
    "# Add intercept column\n",
    "X_b = np.column_stack(\n",
    "    np.ones(x.shape[0]),X\n",
    ")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 57,
   "id": "10254985",
   "metadata": {
    "collapsed": true
   },
   "outputs": [
    {
     "ename": "ValueError",
     "evalue": "all the input array dimensions except for the concatenation axis must match exactly, but along dimension 0, the array at index 0 has size 14 and the array at index 1 has size 3",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mValueError\u001b[0m                                Traceback (most recent call last)",
      "Cell \u001b[1;32mIn[57], line 2\u001b[0m\n\u001b[0;32m      1\u001b[0m \u001b[38;5;66;03m# Add intercept column\u001b[39;00m\n\u001b[1;32m----> 2\u001b[0m X_b \u001b[38;5;241m=\u001b[39m \u001b[43mnp\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mcolumn_stack\u001b[49m\u001b[43m(\u001b[49m\n\u001b[0;32m      3\u001b[0m \u001b[43m    \u001b[49m\u001b[43m[\u001b[49m\u001b[43mnp\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mones\u001b[49m\u001b[43m(\u001b[49m\u001b[43mx\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mshape\u001b[49m\u001b[43m[\u001b[49m\u001b[38;5;241;43m0\u001b[39;49m\u001b[43m]\u001b[49m\u001b[43m)\u001b[49m\u001b[43m,\u001b[49m\u001b[43mX\u001b[49m\u001b[43m]\u001b[49m\n\u001b[0;32m      4\u001b[0m \u001b[43m)\u001b[49m\n",
      "File \u001b[1;32m<__array_function__ internals>:200\u001b[0m, in \u001b[0;36mcolumn_stack\u001b[1;34m(*args, **kwargs)\u001b[0m\n",
      "File \u001b[1;32mD:\\miniconda3\\envs\\pydata-book\\lib\\site-packages\\numpy\\lib\\shape_base.py:656\u001b[0m, in \u001b[0;36mcolumn_stack\u001b[1;34m(tup)\u001b[0m\n\u001b[0;32m    654\u001b[0m         arr \u001b[38;5;241m=\u001b[39m array(arr, copy\u001b[38;5;241m=\u001b[39m\u001b[38;5;28;01mFalse\u001b[39;00m, subok\u001b[38;5;241m=\u001b[39m\u001b[38;5;28;01mTrue\u001b[39;00m, ndmin\u001b[38;5;241m=\u001b[39m\u001b[38;5;241m2\u001b[39m)\u001b[38;5;241m.\u001b[39mT\n\u001b[0;32m    655\u001b[0m     arrays\u001b[38;5;241m.\u001b[39mappend(arr)\n\u001b[1;32m--> 656\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43m_nx\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mconcatenate\u001b[49m\u001b[43m(\u001b[49m\u001b[43marrays\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m1\u001b[39;49m\u001b[43m)\u001b[49m\n",
      "File \u001b[1;32m<__array_function__ internals>:200\u001b[0m, in \u001b[0;36mconcatenate\u001b[1;34m(*args, **kwargs)\u001b[0m\n",
      "\u001b[1;31mValueError\u001b[0m: all the input array dimensions except for the concatenation axis must match exactly, but along dimension 0, the array at index 0 has size 14 and the array at index 1 has size 3"
     ]
    }
   ],
   "source": [
    "# Add intercept column\n",
    "X_b = np.column_stack(\n",
    "    [np.ones(x.shape[0]),X]\n",
    ")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 59,
   "id": "2019ada7",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "3"
      ]
     },
     "execution_count": 59,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "X.shape[0]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "cc8516ea",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 60,
   "id": "cd684630",
   "metadata": {},
   "outputs": [
    {
     "ename": "TypeError",
     "evalue": "column_stack() takes 1 positional argument but 2 were given",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mTypeError\u001b[0m                                 Traceback (most recent call last)",
      "Cell \u001b[1;32mIn[60], line 2\u001b[0m\n\u001b[0;32m      1\u001b[0m \u001b[38;5;66;03m# Add intercept column\u001b[39;00m\n\u001b[1;32m----> 2\u001b[0m X_b \u001b[38;5;241m=\u001b[39m \u001b[43mnp\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mcolumn_stack\u001b[49m\u001b[43m(\u001b[49m\u001b[43mnp\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mones\u001b[49m\u001b[43m(\u001b[49m\u001b[43mX\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mshape\u001b[49m\u001b[43m[\u001b[49m\u001b[38;5;241;43m0\u001b[39;49m\u001b[43m]\u001b[49m\u001b[43m)\u001b[49m\u001b[43m,\u001b[49m\u001b[43mX\u001b[49m\u001b[43m)\u001b[49m\n",
      "File \u001b[1;32m<__array_function__ internals>:198\u001b[0m, in \u001b[0;36mcolumn_stack\u001b[1;34m(*args, **kwargs)\u001b[0m\n",
      "\u001b[1;31mTypeError\u001b[0m: column_stack() takes 1 positional argument but 2 were given"
     ]
    }
   ],
   "source": [
    "# Add intercept column\n",
    "X_b = np.column_stack(np.ones(X.shape[0]),X)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 61,
   "id": "4773c890",
   "metadata": {},
   "outputs": [
    {
     "ename": "SyntaxError",
     "evalue": "unexpected EOF while parsing (53882761.py, line 2)",
     "output_type": "error",
     "traceback": [
      "\u001b[1;36m  Cell \u001b[1;32mIn[61], line 2\u001b[1;36m\u001b[0m\n\u001b[1;33m    X_b = np.column_stack((np.ones(X.shape[0]),X)\u001b[0m\n\u001b[1;37m                                                 ^\u001b[0m\n\u001b[1;31mSyntaxError\u001b[0m\u001b[1;31m:\u001b[0m unexpected EOF while parsing\n"
     ]
    }
   ],
   "source": [
    "# Add intercept column\n",
    "X_b = np.column_stack((np.ones(X.shape[0]),X)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 62,
   "id": "ff0625ae",
   "metadata": {},
   "outputs": [],
   "source": [
    "# Add intercept column\n",
    "X_b = np.column_stack((np.ones(X.shape[0]),X))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 63,
   "id": "e84f3a9c",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[1., 1., 2.],\n",
       "       [1., 2., 3.],\n",
       "       [1., 3., 4.]])"
      ]
     },
     "execution_count": 63,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "X_b"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 64,
   "id": "751a8b22",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[1., 2.],\n",
       "       [2., 3.],\n",
       "       [3., 4.]])"
      ]
     },
     "execution_count": 64,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "X"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 65,
   "id": "d0286283",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([ 4.,  8., 10.])"
      ]
     },
     "execution_count": 65,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "y"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 66,
   "id": "34a482c6",
   "metadata": {},
   "outputs": [],
   "source": [
    "# objective function\n",
    "def least_squares_loss(beat,X,y):\n",
    "    y_pred = X.dot(beta)\n",
    "    errors = y - y_pred\n",
    "    return np.sum(errors ** 2)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "2904dff1",
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "d429e643",
   "metadata": {
    "collapsed": true
   },
   "outputs": [
    {
     "ename": "FileNotFoundError",
     "evalue": "[Errno 2] No such file or directory: 'Table-8.1.csv'",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mFileNotFoundError\u001b[0m                         Traceback (most recent call last)",
      "Cell \u001b[1;32mIn[2], line 1\u001b[0m\n\u001b[1;32m----> 1\u001b[0m \u001b[43mpd\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mread_csv\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mTable-8.1.csv\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m)\u001b[49m\n",
      "File \u001b[1;32mD:\\miniconda3\\envs\\pydata-book\\lib\\site-packages\\pandas\\io\\parsers\\readers.py:912\u001b[0m, in \u001b[0;36mread_csv\u001b[1;34m(filepath_or_buffer, sep, delimiter, header, names, index_col, usecols, dtype, engine, converters, true_values, false_values, skipinitialspace, skiprows, skipfooter, nrows, na_values, keep_default_na, na_filter, verbose, skip_blank_lines, parse_dates, infer_datetime_format, keep_date_col, date_parser, date_format, dayfirst, cache_dates, iterator, chunksize, compression, thousands, decimal, lineterminator, quotechar, quoting, doublequote, escapechar, comment, encoding, encoding_errors, dialect, on_bad_lines, delim_whitespace, low_memory, memory_map, float_precision, storage_options, dtype_backend)\u001b[0m\n\u001b[0;32m    899\u001b[0m kwds_defaults \u001b[38;5;241m=\u001b[39m _refine_defaults_read(\n\u001b[0;32m    900\u001b[0m     dialect,\n\u001b[0;32m    901\u001b[0m     delimiter,\n\u001b[1;32m   (...)\u001b[0m\n\u001b[0;32m    908\u001b[0m     dtype_backend\u001b[38;5;241m=\u001b[39mdtype_backend,\n\u001b[0;32m    909\u001b[0m )\n\u001b[0;32m    910\u001b[0m kwds\u001b[38;5;241m.\u001b[39mupdate(kwds_defaults)\n\u001b[1;32m--> 912\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43m_read\u001b[49m\u001b[43m(\u001b[49m\u001b[43mfilepath_or_buffer\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mkwds\u001b[49m\u001b[43m)\u001b[49m\n",
      "File \u001b[1;32mD:\\miniconda3\\envs\\pydata-book\\lib\\site-packages\\pandas\\io\\parsers\\readers.py:577\u001b[0m, in \u001b[0;36m_read\u001b[1;34m(filepath_or_buffer, kwds)\u001b[0m\n\u001b[0;32m    574\u001b[0m _validate_names(kwds\u001b[38;5;241m.\u001b[39mget(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mnames\u001b[39m\u001b[38;5;124m\"\u001b[39m, \u001b[38;5;28;01mNone\u001b[39;00m))\n\u001b[0;32m    576\u001b[0m \u001b[38;5;66;03m# Create the parser.\u001b[39;00m\n\u001b[1;32m--> 577\u001b[0m parser \u001b[38;5;241m=\u001b[39m \u001b[43mTextFileReader\u001b[49m\u001b[43m(\u001b[49m\u001b[43mfilepath_or_buffer\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43mkwds\u001b[49m\u001b[43m)\u001b[49m\n\u001b[0;32m    579\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m chunksize \u001b[38;5;129;01mor\u001b[39;00m iterator:\n\u001b[0;32m    580\u001b[0m     \u001b[38;5;28;01mreturn\u001b[39;00m parser\n",
      "File \u001b[1;32mD:\\miniconda3\\envs\\pydata-book\\lib\\site-packages\\pandas\\io\\parsers\\readers.py:1407\u001b[0m, in \u001b[0;36mTextFileReader.__init__\u001b[1;34m(self, f, engine, **kwds)\u001b[0m\n\u001b[0;32m   1404\u001b[0m     \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39moptions[\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mhas_index_names\u001b[39m\u001b[38;5;124m\"\u001b[39m] \u001b[38;5;241m=\u001b[39m kwds[\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mhas_index_names\u001b[39m\u001b[38;5;124m\"\u001b[39m]\n\u001b[0;32m   1406\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mhandles: IOHandles \u001b[38;5;241m|\u001b[39m \u001b[38;5;28;01mNone\u001b[39;00m \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;01mNone\u001b[39;00m\n\u001b[1;32m-> 1407\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_engine \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_make_engine\u001b[49m\u001b[43m(\u001b[49m\u001b[43mf\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mengine\u001b[49m\u001b[43m)\u001b[49m\n",
      "File \u001b[1;32mD:\\miniconda3\\envs\\pydata-book\\lib\\site-packages\\pandas\\io\\parsers\\readers.py:1661\u001b[0m, in \u001b[0;36mTextFileReader._make_engine\u001b[1;34m(self, f, engine)\u001b[0m\n\u001b[0;32m   1659\u001b[0m     \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mb\u001b[39m\u001b[38;5;124m\"\u001b[39m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;129;01min\u001b[39;00m mode:\n\u001b[0;32m   1660\u001b[0m         mode \u001b[38;5;241m+\u001b[39m\u001b[38;5;241m=\u001b[39m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mb\u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[1;32m-> 1661\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mhandles \u001b[38;5;241m=\u001b[39m \u001b[43mget_handle\u001b[49m\u001b[43m(\u001b[49m\n\u001b[0;32m   1662\u001b[0m \u001b[43m    \u001b[49m\u001b[43mf\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m   1663\u001b[0m \u001b[43m    \u001b[49m\u001b[43mmode\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m   1664\u001b[0m \u001b[43m    \u001b[49m\u001b[43mencoding\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43moptions\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mget\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mencoding\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;28;43;01mNone\u001b[39;49;00m\u001b[43m)\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m   1665\u001b[0m \u001b[43m    \u001b[49m\u001b[43mcompression\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43moptions\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mget\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mcompression\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;28;43;01mNone\u001b[39;49;00m\u001b[43m)\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m   1666\u001b[0m \u001b[43m    \u001b[49m\u001b[43mmemory_map\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43moptions\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mget\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mmemory_map\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;28;43;01mFalse\u001b[39;49;00m\u001b[43m)\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m   1667\u001b[0m \u001b[43m    \u001b[49m\u001b[43mis_text\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mis_text\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m   1668\u001b[0m \u001b[43m    \u001b[49m\u001b[43merrors\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43moptions\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mget\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mencoding_errors\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mstrict\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m)\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m   1669\u001b[0m \u001b[43m    \u001b[49m\u001b[43mstorage_options\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43moptions\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mget\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mstorage_options\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;28;43;01mNone\u001b[39;49;00m\u001b[43m)\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m   1670\u001b[0m \u001b[43m\u001b[49m\u001b[43m)\u001b[49m\n\u001b[0;32m   1671\u001b[0m \u001b[38;5;28;01massert\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mhandles \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m\n\u001b[0;32m   1672\u001b[0m f \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mhandles\u001b[38;5;241m.\u001b[39mhandle\n",
      "File \u001b[1;32mD:\\miniconda3\\envs\\pydata-book\\lib\\site-packages\\pandas\\io\\common.py:859\u001b[0m, in \u001b[0;36mget_handle\u001b[1;34m(path_or_buf, mode, encoding, compression, memory_map, is_text, errors, storage_options)\u001b[0m\n\u001b[0;32m    854\u001b[0m \u001b[38;5;28;01melif\u001b[39;00m \u001b[38;5;28misinstance\u001b[39m(handle, \u001b[38;5;28mstr\u001b[39m):\n\u001b[0;32m    855\u001b[0m     \u001b[38;5;66;03m# Check whether the filename is to be opened in binary mode.\u001b[39;00m\n\u001b[0;32m    856\u001b[0m     \u001b[38;5;66;03m# Binary mode does not support 'encoding' and 'newline'.\u001b[39;00m\n\u001b[0;32m    857\u001b[0m     \u001b[38;5;28;01mif\u001b[39;00m ioargs\u001b[38;5;241m.\u001b[39mencoding \u001b[38;5;129;01mand\u001b[39;00m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mb\u001b[39m\u001b[38;5;124m\"\u001b[39m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;129;01min\u001b[39;00m ioargs\u001b[38;5;241m.\u001b[39mmode:\n\u001b[0;32m    858\u001b[0m         \u001b[38;5;66;03m# Encoding\u001b[39;00m\n\u001b[1;32m--> 859\u001b[0m         handle \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;43mopen\u001b[39;49m\u001b[43m(\u001b[49m\n\u001b[0;32m    860\u001b[0m \u001b[43m            \u001b[49m\u001b[43mhandle\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m    861\u001b[0m \u001b[43m            \u001b[49m\u001b[43mioargs\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mmode\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m    862\u001b[0m \u001b[43m            \u001b[49m\u001b[43mencoding\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mioargs\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mencoding\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m    863\u001b[0m \u001b[43m            \u001b[49m\u001b[43merrors\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43merrors\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m    864\u001b[0m \u001b[43m            \u001b[49m\u001b[43mnewline\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m,\u001b[49m\n\u001b[0;32m    865\u001b[0m \u001b[43m        \u001b[49m\u001b[43m)\u001b[49m\n\u001b[0;32m    866\u001b[0m     \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[0;32m    867\u001b[0m         \u001b[38;5;66;03m# Binary mode\u001b[39;00m\n\u001b[0;32m    868\u001b[0m         handle \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mopen\u001b[39m(handle, ioargs\u001b[38;5;241m.\u001b[39mmode)\n",
      "\u001b[1;31mFileNotFoundError\u001b[0m: [Errno 2] No such file or directory: 'Table-8.1.csv'"
     ]
    }
   ],
   "source": [
    "pd.read_csv(\"Table-8.1.csv\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "8dbe6444",
   "metadata": {},
   "outputs": [],
   "source": [
    "df = pd.read_csv('examples/Table-8.1.csv')\n",
    "x = df['Weight (kg)'].values\n",
    "y = df['Height (cm)'].values"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "73980fe2",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Friend</th>\n",
       "      <th>Weight (kg)</th>\n",
       "      <th>Height (cm)</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>Andrew</td>\n",
       "      <td>77</td>\n",
       "      <td>175</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>Bernhard</td>\n",
       "      <td>110</td>\n",
       "      <td>195</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>Carolina</td>\n",
       "      <td>70</td>\n",
       "      <td>172</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>Dennis</td>\n",
       "      <td>85</td>\n",
       "      <td>180</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>Eve</td>\n",
       "      <td>65</td>\n",
       "      <td>168</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>Fred</td>\n",
       "      <td>75</td>\n",
       "      <td>173</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>Gwyneth</td>\n",
       "      <td>75</td>\n",
       "      <td>180</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>Hayden</td>\n",
       "      <td>63</td>\n",
       "      <td>165</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>Irene</td>\n",
       "      <td>55</td>\n",
       "      <td>158</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>James</td>\n",
       "      <td>66</td>\n",
       "      <td>163</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>Kevin</td>\n",
       "      <td>95</td>\n",
       "      <td>190</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>Lea</td>\n",
       "      <td>72</td>\n",
       "      <td>172</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>Marcus</td>\n",
       "      <td>83</td>\n",
       "      <td>185</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>Nigel</td>\n",
       "      <td>115</td>\n",
       "      <td>192</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "      Friend  Weight (kg)  Height (cm)\n",
       "0     Andrew           77          175\n",
       "1   Bernhard          110          195\n",
       "2   Carolina           70          172\n",
       "3     Dennis           85          180\n",
       "4        Eve           65          168\n",
       "5       Fred           75          173\n",
       "6    Gwyneth           75          180\n",
       "7     Hayden           63          165\n",
       "8      Irene           55          158\n",
       "9      James           66          163\n",
       "10     Kevin           95          190\n",
       "11       Lea           72          172\n",
       "12    Marcus           83          185\n",
       "13     Nigel          115          192"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "45801e76",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([ 77, 110,  70,  85,  65,  75,  75,  63,  55,  66,  95,  72,  83,\n",
       "       115], dtype=int64)"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "x"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "45eba04f",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([175, 195, 172, 180, 168, 173, 180, 165, 158, 163, 190, 172, 185,\n",
       "       192], dtype=int64)"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "y"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "28101167",
   "metadata": {},
   "outputs": [
    {
     "ename": "NameError",
     "evalue": "name 'x' is not defined",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mNameError\u001b[0m                                 Traceback (most recent call last)",
      "Cell \u001b[1;32mIn[1], line 1\u001b[0m\n\u001b[1;32m----> 1\u001b[0m \u001b[43mx\u001b[49m\n",
      "\u001b[1;31mNameError\u001b[0m: name 'x' is not defined"
     ]
    }
   ],
   "source": [
    "x"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "bfca23af",
   "metadata": {},
   "outputs": [
    {
     "ename": "NameError",
     "evalue": "name 'pd' is not defined",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mNameError\u001b[0m                                 Traceback (most recent call last)",
      "Cell \u001b[1;32mIn[2], line 1\u001b[0m\n\u001b[1;32m----> 1\u001b[0m df \u001b[38;5;241m=\u001b[39m \u001b[43mpd\u001b[49m\u001b[38;5;241m.\u001b[39mread_csv(\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mexamples/Table-8.1.csv\u001b[39m\u001b[38;5;124m'\u001b[39m)\n\u001b[0;32m      2\u001b[0m x \u001b[38;5;241m=\u001b[39m df[\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mWeight (kg)\u001b[39m\u001b[38;5;124m'\u001b[39m]\u001b[38;5;241m.\u001b[39mvalues\n\u001b[0;32m      3\u001b[0m y \u001b[38;5;241m=\u001b[39m df[\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mHeight (cm)\u001b[39m\u001b[38;5;124m'\u001b[39m]\u001b[38;5;241m.\u001b[39mvalues\n",
      "\u001b[1;31mNameError\u001b[0m: name 'pd' is not defined"
     ]
    }
   ],
   "source": [
    "df = pd.read_csv('examples/Table-8.1.csv')\n",
    "x = df['Weight (kg)'].values\n",
    "y = df['Height (cm)'].values"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "d2291a23",
   "metadata": {},
   "outputs": [],
   "source": [
    "import numpy as np"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "132d3922",
   "metadata": {},
   "outputs": [
    {
     "ename": "NameError",
     "evalue": "name 'pd' is not defined",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mNameError\u001b[0m                                 Traceback (most recent call last)",
      "Cell \u001b[1;32mIn[4], line 1\u001b[0m\n\u001b[1;32m----> 1\u001b[0m df \u001b[38;5;241m=\u001b[39m \u001b[43mpd\u001b[49m\u001b[38;5;241m.\u001b[39mread_csv(\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mexamples/Table-8.1.csv\u001b[39m\u001b[38;5;124m'\u001b[39m)\n\u001b[0;32m      2\u001b[0m x \u001b[38;5;241m=\u001b[39m df[\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mWeight (kg)\u001b[39m\u001b[38;5;124m'\u001b[39m]\u001b[38;5;241m.\u001b[39mvalues\n\u001b[0;32m      3\u001b[0m y \u001b[38;5;241m=\u001b[39m df[\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mHeight (cm)\u001b[39m\u001b[38;5;124m'\u001b[39m]\u001b[38;5;241m.\u001b[39mvalues\n",
      "\u001b[1;31mNameError\u001b[0m: name 'pd' is not defined"
     ]
    }
   ],
   "source": [
    "df = pd.read_csv('examples/Table-8.1.csv')\n",
    "x = df['Weight (kg)'].values\n",
    "y = df['Height (cm)'].values"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "8bfeba90",
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "304ac665",
   "metadata": {},
   "outputs": [],
   "source": [
    "df = pd.read_csv('examples/Table-8.1.csv')\n",
    "x = df['Weight (kg)'].values\n",
    "y = df['Height (cm)'].values"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "id": "3f299290",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([ 77, 110,  70,  85,  65,  75,  75,  63,  55,  66,  95,  72,  83,\n",
       "       115], dtype=int64)"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "x"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "id": "7c41535f",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([175, 195, 172, 180, 168, 173, 180, 165, 158, 163, 190, 172, 185,\n",
       "       192], dtype=int64)"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "y"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "id": "1c1255e6",
   "metadata": {},
   "outputs": [],
   "source": [
    "def cal_squared_error(beta_0, beta_1, x, y):\n",
    "    y_pred = beta_0 + beta_1 * x\n",
    "    # 差异值\n",
    "    error = y - y_pred\n",
    "    # 返回值\n",
    "    return np.sum(error ** 2)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "id": "c5bc3553",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "77660"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "cal_squared_error(2,3,x,y)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "id": "5b09c218",
   "metadata": {
    "collapsed": true
   },
   "outputs": [
    {
     "ename": "NameError",
     "evalue": "name 'beta1' is not defined",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mNameError\u001b[0m                                 Traceback (most recent call last)",
      "Cell \u001b[1;32mIn[11], line 7\u001b[0m\n\u001b[0;32m      5\u001b[0m y_mean \u001b[38;5;241m=\u001b[39m np\u001b[38;5;241m.\u001b[39mmean(y)\n\u001b[0;32m      6\u001b[0m beta_1 \u001b[38;5;241m=\u001b[39m np\u001b[38;5;241m.\u001b[39msum(x\u001b[38;5;241m-\u001b[39mx_mean) \u001b[38;5;241m/\u001b[39m np\u001b[38;5;241m.\u001b[39msum(y\u001b[38;5;241m-\u001b[39my_mean)\n\u001b[1;32m----> 7\u001b[0m beta_0 \u001b[38;5;241m=\u001b[39m y_mean \u001b[38;5;241m-\u001b[39m \u001b[43mbeta1\u001b[49m \u001b[38;5;241m*\u001b[39m x_mean\n",
      "\u001b[1;31mNameError\u001b[0m: name 'beta1' is not defined"
     ]
    }
   ],
   "source": [
    "# 根据least square\n",
    "# 斜率 slope beta_1 = cov(x,y) / cov(x,x)\n",
    "# 截距 intercept beta_0 = y_mean - beta_1 * x_mean\n",
    "x_mean = np.mean(x)\n",
    "y_mean = np.mean(y)\n",
    "beta_1 = np.sum(x-x_mean) / np.sum(y-y_mean)\n",
    "beta_0 = y_mean - beta1 * x_mean"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "id": "26b66219",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 根据least square\n",
    "# 斜率 slope beta_1 = cov(x,y) / cov(x,x)\n",
    "# 截距 intercept beta_0 = y_mean - beta_1 * x_mean\n",
    "x_mean = np.mean(x)\n",
    "y_mean = np.mean(y)\n",
    "beta_1 = np.sum((x-x_mean)(y-y_mean)) / np.sum((x-x_mean)**2)\n",
    "beta_0 = y_mean - beta_1 * x_mean"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "id": "893598d0",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(0.0, 176.28571428571428)"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "beta_1,beta_0"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "id": "f66428be",
   "metadata": {},
   "outputs": [
    {
     "ename": "TypeError",
     "evalue": "'numpy.ndarray' object is not callable",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mTypeError\u001b[0m                                 Traceback (most recent call last)",
      "Cell \u001b[1;32mIn[14], line 6\u001b[0m\n\u001b[0;32m      4\u001b[0m x_mean \u001b[38;5;241m=\u001b[39m np\u001b[38;5;241m.\u001b[39mmean(x)\n\u001b[0;32m      5\u001b[0m y_mean \u001b[38;5;241m=\u001b[39m np\u001b[38;5;241m.\u001b[39mmean(y)\n\u001b[1;32m----> 6\u001b[0m beta_1 \u001b[38;5;241m=\u001b[39m np\u001b[38;5;241m.\u001b[39msum(\u001b[43m(\u001b[49m\u001b[43mx\u001b[49m\u001b[38;5;241;43m-\u001b[39;49m\u001b[43mx_mean\u001b[49m\u001b[43m)\u001b[49m\u001b[43m(\u001b[49m\u001b[43my\u001b[49m\u001b[38;5;241;43m-\u001b[39;49m\u001b[43my_mean\u001b[49m\u001b[43m)\u001b[49m) \u001b[38;5;241m/\u001b[39m np\u001b[38;5;241m.\u001b[39msum((x\u001b[38;5;241m-\u001b[39mx_mean)\u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39m\u001b[38;5;241m2\u001b[39m)\n\u001b[0;32m      7\u001b[0m beta_0 \u001b[38;5;241m=\u001b[39m y_mean \u001b[38;5;241m-\u001b[39m beta_1 \u001b[38;5;241m*\u001b[39m x_mean\n",
      "\u001b[1;31mTypeError\u001b[0m: 'numpy.ndarray' object is not callable"
     ]
    }
   ],
   "source": [
    "# 根据least square\n",
    "# 斜率 slope beta_1 = cov(x,y) / cov(x,x)\n",
    "# 截距 intercept beta_0 = y_mean - beta_1 * x_mean\n",
    "x_mean = np.mean(x)\n",
    "y_mean = np.mean(y)\n",
    "beta_1 = np.sum((x-x_mean)(y-y_mean)) / np.sum((x-x_mean)**2)\n",
    "beta_0 = y_mean - beta_1 * x_mean"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "id": "98901b5f",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 根据least square\n",
    "# 斜率 slope beta_1 = cov(x,y) / cov(x,x)\n",
    "# 截距 intercept beta_0 = y_mean - beta_1 * x_mean\n",
    "x_mean = np.mean(x)\n",
    "y_mean = np.mean(y)\n",
    "beta_1 = np.sum((x-x_mean)*(y-y_mean)) / np.sum((x-x_mean)**2)\n",
    "beta_0 = y_mean - beta_1 * x_mean"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "id": "3c8993f8",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(0.6109979633401222, 128.01687518184463)"
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "beta_1,beta_0"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "id": "0fd1e6f1",
   "metadata": {},
   "outputs": [
    {
     "ename": "TypeError",
     "evalue": "Cannot construct a dtype from an array",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mTypeError\u001b[0m                                 Traceback (most recent call last)",
      "Cell \u001b[1;32mIn[17], line 8\u001b[0m\n\u001b[0;32m      5\u001b[0m x \u001b[38;5;241m=\u001b[39m np\u001b[38;5;241m.\u001b[39mrandom\u001b[38;5;241m.\u001b[39mrand(n,p)\n\u001b[0;32m      6\u001b[0m y \u001b[38;5;241m=\u001b[39m np\u001b[38;5;241m.\u001b[39marray([\u001b[38;5;241m4\u001b[39m,\u001b[38;5;241m8\u001b[39m,\u001b[38;5;241m10\u001b[39m], dtype \u001b[38;5;241m=\u001b[39m\u001b[38;5;28mfloat\u001b[39m)\n\u001b[1;32m----> 8\u001b[0m X \u001b[38;5;241m=\u001b[39m np\u001b[38;5;241m.\u001b[39mcolumn_stack(\u001b[43mnp\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mones\u001b[49m\u001b[43m(\u001b[49m\u001b[43mx\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mshape\u001b[49m\u001b[43m[\u001b[49m\u001b[38;5;241;43m0\u001b[39;49m\u001b[43m]\u001b[49m\u001b[43m,\u001b[49m\u001b[43mx\u001b[49m\u001b[43m)\u001b[49m)\n\u001b[0;32m      9\u001b[0m beta \u001b[38;5;241m=\u001b[39m np\u001b[38;5;241m.\u001b[39mlinalg\u001b[38;5;241m.\u001b[39minv(X\u001b[38;5;241m.\u001b[39mT \u001b[38;5;241m@\u001b[39m X) \u001b[38;5;241m@\u001b[39m X \u001b[38;5;241m@\u001b[39m y\n",
      "File \u001b[1;32mD:\\miniconda3\\envs\\pydata-book\\lib\\site-packages\\numpy\\core\\numeric.py:205\u001b[0m, in \u001b[0;36mones\u001b[1;34m(shape, dtype, order, like)\u001b[0m\n\u001b[0;32m    202\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m like \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m:\n\u001b[0;32m    203\u001b[0m     \u001b[38;5;28;01mreturn\u001b[39;00m _ones_with_like(shape, dtype\u001b[38;5;241m=\u001b[39mdtype, order\u001b[38;5;241m=\u001b[39morder, like\u001b[38;5;241m=\u001b[39mlike)\n\u001b[1;32m--> 205\u001b[0m a \u001b[38;5;241m=\u001b[39m \u001b[43mempty\u001b[49m\u001b[43m(\u001b[49m\u001b[43mshape\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mdtype\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43morder\u001b[49m\u001b[43m)\u001b[49m\n\u001b[0;32m    206\u001b[0m multiarray\u001b[38;5;241m.\u001b[39mcopyto(a, \u001b[38;5;241m1\u001b[39m, casting\u001b[38;5;241m=\u001b[39m\u001b[38;5;124m'\u001b[39m\u001b[38;5;124munsafe\u001b[39m\u001b[38;5;124m'\u001b[39m)\n\u001b[0;32m    207\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m a\n",
      "\u001b[1;31mTypeError\u001b[0m: Cannot construct a dtype from an array"
     ]
    }
   ],
   "source": [
    "# shape(10,3)\n",
    "n = 10\n",
    "p = 3\n",
    "\n",
    "x = np.random.rand(n,p)\n",
    "y = np.array([4,8,10], dtype =float)\n",
    "\n",
    "X = np.column_stack(np.ones(x.shape[0],x))\n",
    "beta = np.linalg.inv(X.T @ X) @ X @ y"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "id": "63daf7c6",
   "metadata": {},
   "outputs": [],
   "source": [
    "# shape(10,3)\n",
    "n = 10\n",
    "p = 3\n",
    "\n",
    "x = np.random.rand(n,p)\n",
    "y = np.array([4,8,10], dtype =float)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "id": "ca573df5",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(10, 3)"
      ]
     },
     "execution_count": 19,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "x.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "id": "0f246820",
   "metadata": {},
   "outputs": [],
   "source": [
    "X = np.column_stack([np.ones(x.shape[0]),x])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "id": "b1272a21",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[1.        , 0.29449021, 0.79572385, 0.44992031],\n",
       "       [1.        , 0.53166431, 0.43857412, 0.13191768],\n",
       "       [1.        , 0.14333049, 0.88151089, 0.55467376],\n",
       "       [1.        , 0.90570705, 0.21578076, 0.81445665],\n",
       "       [1.        , 0.75326507, 0.62855379, 0.91831434],\n",
       "       [1.        , 0.00751915, 0.09655111, 0.62605851],\n",
       "       [1.        , 0.01078349, 0.16161924, 0.99870259],\n",
       "       [1.        , 0.91480268, 0.98570851, 0.44813014],\n",
       "       [1.        , 0.37084153, 0.41386298, 0.74061767],\n",
       "       [1.        , 0.85655015, 0.84179582, 0.7076875 ]])"
      ]
     },
     "execution_count": 21,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "X"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "id": "a8cbb87b",
   "metadata": {},
   "outputs": [
    {
     "ename": "ValueError",
     "evalue": "matmul: Input operand 1 has a mismatch in its core dimension 0, with gufunc signature (n?,k),(k,m?)->(n?,m?) (size 10 is different from 4)",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mValueError\u001b[0m                                Traceback (most recent call last)",
      "Cell \u001b[1;32mIn[22], line 1\u001b[0m\n\u001b[1;32m----> 1\u001b[0m beta \u001b[38;5;241m=\u001b[39m \u001b[43mnp\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mlinalg\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43minv\u001b[49m\u001b[43m(\u001b[49m\u001b[43mX\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mT\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m@\u001b[39;49m\u001b[43m \u001b[49m\u001b[43mX\u001b[49m\u001b[43m)\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m@\u001b[39;49m\u001b[43m \u001b[49m\u001b[43mX\u001b[49m \u001b[38;5;241m@\u001b[39m y\n",
      "\u001b[1;31mValueError\u001b[0m: matmul: Input operand 1 has a mismatch in its core dimension 0, with gufunc signature (n?,k),(k,m?)->(n?,m?) (size 10 is different from 4)"
     ]
    }
   ],
   "source": [
    "beta = np.linalg.inv(X.T @ X) @ X @ y"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "id": "2c162134",
   "metadata": {},
   "outputs": [
    {
     "ename": "ValueError",
     "evalue": "matmul: Input operand 1 has a mismatch in its core dimension 0, with gufunc signature (n?,k),(k,m?)->(n?,m?) (size 3 is different from 10)",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mValueError\u001b[0m                                Traceback (most recent call last)",
      "Cell \u001b[1;32mIn[23], line 1\u001b[0m\n\u001b[1;32m----> 1\u001b[0m beta \u001b[38;5;241m=\u001b[39m \u001b[43mnp\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mlinalg\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43minv\u001b[49m\u001b[43m(\u001b[49m\u001b[43mX\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mT\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m@\u001b[39;49m\u001b[43m \u001b[49m\u001b[43mX\u001b[49m\u001b[43m)\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m@\u001b[39;49m\u001b[43m \u001b[49m\u001b[43mX\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mT\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m@\u001b[39;49m\u001b[43m \u001b[49m\u001b[43my\u001b[49m\n",
      "\u001b[1;31mValueError\u001b[0m: matmul: Input operand 1 has a mismatch in its core dimension 0, with gufunc signature (n?,k),(k,m?)->(n?,m?) (size 3 is different from 10)"
     ]
    }
   ],
   "source": [
    "beta = np.linalg.inv(X.T @ X) @ X.T @ y"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "id": "99923300",
   "metadata": {},
   "outputs": [
    {
     "ename": "ValueError",
     "evalue": "matmul: Input operand 1 has a mismatch in its core dimension 0, with gufunc signature (n?,k),(k,m?)->(n?,m?) (size 3 is different from 10)",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mValueError\u001b[0m                                Traceback (most recent call last)",
      "Cell \u001b[1;32mIn[24], line 1\u001b[0m\n\u001b[1;32m----> 1\u001b[0m beta \u001b[38;5;241m=\u001b[39m \u001b[43mnp\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mlinalg\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43minv\u001b[49m\u001b[43m(\u001b[49m\u001b[43mX\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mT\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m@\u001b[39;49m\u001b[43m \u001b[49m\u001b[43mX\u001b[49m\u001b[43m)\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m@\u001b[39;49m\u001b[43m \u001b[49m\u001b[43mX\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mT\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m@\u001b[39;49m\u001b[43m \u001b[49m\u001b[43my\u001b[49m\n",
      "\u001b[1;31mValueError\u001b[0m: matmul: Input operand 1 has a mismatch in its core dimension 0, with gufunc signature (n?,k),(k,m?)->(n?,m?) (size 3 is different from 10)"
     ]
    }
   ],
   "source": [
    "beta = np.linalg.inv(X.T @ X) @ X.T @ y"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "id": "58dce68c",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(10, 10)"
      ]
     },
     "execution_count": 25,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "x.shape[0],len(x)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "id": "90c0a072",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(array([[0.29449021, 0.79572385, 0.44992031],\n",
       "        [0.53166431, 0.43857412, 0.13191768],\n",
       "        [0.14333049, 0.88151089, 0.55467376],\n",
       "        [0.90570705, 0.21578076, 0.81445665],\n",
       "        [0.75326507, 0.62855379, 0.91831434],\n",
       "        [0.00751915, 0.09655111, 0.62605851],\n",
       "        [0.01078349, 0.16161924, 0.99870259],\n",
       "        [0.91480268, 0.98570851, 0.44813014],\n",
       "        [0.37084153, 0.41386298, 0.74061767],\n",
       "        [0.85655015, 0.84179582, 0.7076875 ]]),\n",
       " array([ 4.,  8., 10.]))"
      ]
     },
     "execution_count": 26,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "x,y"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "id": "2b8719af",
   "metadata": {},
   "outputs": [],
   "source": [
    "# shape(10,3)\n",
    "n = 10\n",
    "p = 3\n",
    "\n",
    "x = np.random.rand(n,p)\n",
    "y = np.array([4,8,10,1,1,1,1,1,1,1], dtype =float)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "id": "44f75953",
   "metadata": {},
   "outputs": [
    {
     "ename": "ValueError",
     "evalue": "all the input array dimensions except for the concatenation axis must match exactly, but along dimension 0, the array at index 0 has size 1 and the array at index 1 has size 10",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mValueError\u001b[0m                                Traceback (most recent call last)",
      "Cell \u001b[1;32mIn[28], line 1\u001b[0m\n\u001b[1;32m----> 1\u001b[0m X \u001b[38;5;241m=\u001b[39m \u001b[43mnp\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mcolumn_stack\u001b[49m\u001b[43m(\u001b[49m\u001b[43m[\u001b[49m\u001b[43mx\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mshape\u001b[49m\u001b[43m[\u001b[49m\u001b[38;5;241;43m0\u001b[39;49m\u001b[43m]\u001b[49m\u001b[43m,\u001b[49m\u001b[43mx\u001b[49m\u001b[43m]\u001b[49m\u001b[43m)\u001b[49m\n",
      "File \u001b[1;32m<__array_function__ internals>:200\u001b[0m, in \u001b[0;36mcolumn_stack\u001b[1;34m(*args, **kwargs)\u001b[0m\n",
      "File \u001b[1;32mD:\\miniconda3\\envs\\pydata-book\\lib\\site-packages\\numpy\\lib\\shape_base.py:656\u001b[0m, in \u001b[0;36mcolumn_stack\u001b[1;34m(tup)\u001b[0m\n\u001b[0;32m    654\u001b[0m         arr \u001b[38;5;241m=\u001b[39m array(arr, copy\u001b[38;5;241m=\u001b[39m\u001b[38;5;28;01mFalse\u001b[39;00m, subok\u001b[38;5;241m=\u001b[39m\u001b[38;5;28;01mTrue\u001b[39;00m, ndmin\u001b[38;5;241m=\u001b[39m\u001b[38;5;241m2\u001b[39m)\u001b[38;5;241m.\u001b[39mT\n\u001b[0;32m    655\u001b[0m     arrays\u001b[38;5;241m.\u001b[39mappend(arr)\n\u001b[1;32m--> 656\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43m_nx\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mconcatenate\u001b[49m\u001b[43m(\u001b[49m\u001b[43marrays\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m1\u001b[39;49m\u001b[43m)\u001b[49m\n",
      "File \u001b[1;32m<__array_function__ internals>:200\u001b[0m, in \u001b[0;36mconcatenate\u001b[1;34m(*args, **kwargs)\u001b[0m\n",
      "\u001b[1;31mValueError\u001b[0m: all the input array dimensions except for the concatenation axis must match exactly, but along dimension 0, the array at index 0 has size 1 and the array at index 1 has size 10"
     ]
    }
   ],
   "source": [
    "X = np.column_stack([x.shape[0],x])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "id": "0cd42a0c",
   "metadata": {},
   "outputs": [],
   "source": [
    "X = np.column_stack([np.ones(x.shape[0]),x])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "id": "f18065d7",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[1.        , 0.55892712, 0.594929  , 0.65736738],\n",
       "       [1.        , 0.64167475, 0.11266479, 0.11007129],\n",
       "       [1.        , 0.82487146, 0.76865222, 0.33779738],\n",
       "       [1.        , 0.08673042, 0.70043739, 0.96563521],\n",
       "       [1.        , 0.43777525, 0.00279628, 0.20896427],\n",
       "       [1.        , 0.25531969, 0.49977806, 0.26178822],\n",
       "       [1.        , 0.26655718, 0.3406602 , 0.05175474],\n",
       "       [1.        , 0.72177115, 0.0690363 , 0.759487  ],\n",
       "       [1.        , 0.01215444, 0.57237406, 0.80709522],\n",
       "       [1.        , 0.29525723, 0.86341688, 0.15527881]])"
      ]
     },
     "execution_count": 30,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "X"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 31,
   "id": "d9faaee8",
   "metadata": {},
   "outputs": [],
   "source": [
    "beta = np.linalg.inv(X.T @ X) @ X.T @ y"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 32,
   "id": "6bca9e1c",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([-2.27399428,  9.650474  ,  3.90537273, -1.27636968])"
      ]
     },
     "execution_count": 32,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "beta"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 33,
   "id": "acb0a092",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(array([[0.55892712, 0.594929  , 0.65736738],\n",
       "        [0.64167475, 0.11266479, 0.11007129],\n",
       "        [0.82487146, 0.76865222, 0.33779738],\n",
       "        [0.08673042, 0.70043739, 0.96563521],\n",
       "        [0.43777525, 0.00279628, 0.20896427],\n",
       "        [0.25531969, 0.49977806, 0.26178822],\n",
       "        [0.26655718, 0.3406602 , 0.05175474],\n",
       "        [0.72177115, 0.0690363 , 0.759487  ],\n",
       "        [0.01215444, 0.57237406, 0.80709522],\n",
       "        [0.29525723, 0.86341688, 0.15527881]]),\n",
       " array([ 4.,  8., 10.,  1.,  1.,  1.,  1.,  1.,  1.,  1.]))"
      ]
     },
     "execution_count": 33,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "x,y"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "456d4858",
   "metadata": {},
   "outputs": [],
   "source": [
    "import numpy as np"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "e1a14677",
   "metadata": {},
   "outputs": [
    {
     "ename": "SyntaxError",
     "evalue": "invalid syntax (3967016882.py, line 1)",
     "output_type": "error",
     "traceback": [
      "\u001b[1;36m  Cell \u001b[1;32mIn[2], line 1\u001b[1;36m\u001b[0m\n\u001b[1;33m    import sklearn.datasets import load_iris\u001b[0m\n\u001b[1;37m                            ^\u001b[0m\n\u001b[1;31mSyntaxError\u001b[0m\u001b[1;31m:\u001b[0m invalid syntax\n"
     ]
    }
   ],
   "source": [
    "import sklearn.datasets import load_iris"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "3843ddfe",
   "metadata": {},
   "outputs": [],
   "source": [
    "from sklearn.datasets import load_iris"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "ee28fc7f",
   "metadata": {},
   "outputs": [],
   "source": [
    "iris = load_iris()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "7a6fe660",
   "metadata": {},
   "outputs": [],
   "source": [
    "x = iris.data"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "16d32be0",
   "metadata": {},
   "outputs": [
    {
     "ename": "TypeError",
     "evalue": "'tuple' object is not callable",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mTypeError\u001b[0m                                 Traceback (most recent call last)",
      "Cell \u001b[1;32mIn[6], line 1\u001b[0m\n\u001b[1;32m----> 1\u001b[0m \u001b[43mx\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mshape\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n",
      "\u001b[1;31mTypeError\u001b[0m: 'tuple' object is not callable"
     ]
    }
   ],
   "source": [
    "x.shape()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "id": "e12bb4f2",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[5.1, 3.5, 1.4, 0.2],\n",
       "       [4.9, 3. , 1.4, 0.2],\n",
       "       [4.7, 3.2, 1.3, 0.2],\n",
       "       [4.6, 3.1, 1.5, 0.2],\n",
       "       [5. , 3.6, 1.4, 0.2],\n",
       "       [5.4, 3.9, 1.7, 0.4],\n",
       "       [4.6, 3.4, 1.4, 0.3],\n",
       "       [5. , 3.4, 1.5, 0.2],\n",
       "       [4.4, 2.9, 1.4, 0.2],\n",
       "       [4.9, 3.1, 1.5, 0.1],\n",
       "       [5.4, 3.7, 1.5, 0.2],\n",
       "       [4.8, 3.4, 1.6, 0.2],\n",
       "       [4.8, 3. , 1.4, 0.1],\n",
       "       [4.3, 3. , 1.1, 0.1],\n",
       "       [5.8, 4. , 1.2, 0.2],\n",
       "       [5.7, 4.4, 1.5, 0.4],\n",
       "       [5.4, 3.9, 1.3, 0.4],\n",
       "       [5.1, 3.5, 1.4, 0.3],\n",
       "       [5.7, 3.8, 1.7, 0.3],\n",
       "       [5.1, 3.8, 1.5, 0.3],\n",
       "       [5.4, 3.4, 1.7, 0.2],\n",
       "       [5.1, 3.7, 1.5, 0.4],\n",
       "       [4.6, 3.6, 1. , 0.2],\n",
       "       [5.1, 3.3, 1.7, 0.5],\n",
       "       [4.8, 3.4, 1.9, 0.2],\n",
       "       [5. , 3. , 1.6, 0.2],\n",
       "       [5. , 3.4, 1.6, 0.4],\n",
       "       [5.2, 3.5, 1.5, 0.2],\n",
       "       [5.2, 3.4, 1.4, 0.2],\n",
       "       [4.7, 3.2, 1.6, 0.2],\n",
       "       [4.8, 3.1, 1.6, 0.2],\n",
       "       [5.4, 3.4, 1.5, 0.4],\n",
       "       [5.2, 4.1, 1.5, 0.1],\n",
       "       [5.5, 4.2, 1.4, 0.2],\n",
       "       [4.9, 3.1, 1.5, 0.2],\n",
       "       [5. , 3.2, 1.2, 0.2],\n",
       "       [5.5, 3.5, 1.3, 0.2],\n",
       "       [4.9, 3.6, 1.4, 0.1],\n",
       "       [4.4, 3. , 1.3, 0.2],\n",
       "       [5.1, 3.4, 1.5, 0.2],\n",
       "       [5. , 3.5, 1.3, 0.3],\n",
       "       [4.5, 2.3, 1.3, 0.3],\n",
       "       [4.4, 3.2, 1.3, 0.2],\n",
       "       [5. , 3.5, 1.6, 0.6],\n",
       "       [5.1, 3.8, 1.9, 0.4],\n",
       "       [4.8, 3. , 1.4, 0.3],\n",
       "       [5.1, 3.8, 1.6, 0.2],\n",
       "       [4.6, 3.2, 1.4, 0.2],\n",
       "       [5.3, 3.7, 1.5, 0.2],\n",
       "       [5. , 3.3, 1.4, 0.2],\n",
       "       [7. , 3.2, 4.7, 1.4],\n",
       "       [6.4, 3.2, 4.5, 1.5],\n",
       "       [6.9, 3.1, 4.9, 1.5],\n",
       "       [5.5, 2.3, 4. , 1.3],\n",
       "       [6.5, 2.8, 4.6, 1.5],\n",
       "       [5.7, 2.8, 4.5, 1.3],\n",
       "       [6.3, 3.3, 4.7, 1.6],\n",
       "       [4.9, 2.4, 3.3, 1. ],\n",
       "       [6.6, 2.9, 4.6, 1.3],\n",
       "       [5.2, 2.7, 3.9, 1.4],\n",
       "       [5. , 2. , 3.5, 1. ],\n",
       "       [5.9, 3. , 4.2, 1.5],\n",
       "       [6. , 2.2, 4. , 1. ],\n",
       "       [6.1, 2.9, 4.7, 1.4],\n",
       "       [5.6, 2.9, 3.6, 1.3],\n",
       "       [6.7, 3.1, 4.4, 1.4],\n",
       "       [5.6, 3. , 4.5, 1.5],\n",
       "       [5.8, 2.7, 4.1, 1. ],\n",
       "       [6.2, 2.2, 4.5, 1.5],\n",
       "       [5.6, 2.5, 3.9, 1.1],\n",
       "       [5.9, 3.2, 4.8, 1.8],\n",
       "       [6.1, 2.8, 4. , 1.3],\n",
       "       [6.3, 2.5, 4.9, 1.5],\n",
       "       [6.1, 2.8, 4.7, 1.2],\n",
       "       [6.4, 2.9, 4.3, 1.3],\n",
       "       [6.6, 3. , 4.4, 1.4],\n",
       "       [6.8, 2.8, 4.8, 1.4],\n",
       "       [6.7, 3. , 5. , 1.7],\n",
       "       [6. , 2.9, 4.5, 1.5],\n",
       "       [5.7, 2.6, 3.5, 1. ],\n",
       "       [5.5, 2.4, 3.8, 1.1],\n",
       "       [5.5, 2.4, 3.7, 1. ],\n",
       "       [5.8, 2.7, 3.9, 1.2],\n",
       "       [6. , 2.7, 5.1, 1.6],\n",
       "       [5.4, 3. , 4.5, 1.5],\n",
       "       [6. , 3.4, 4.5, 1.6],\n",
       "       [6.7, 3.1, 4.7, 1.5],\n",
       "       [6.3, 2.3, 4.4, 1.3],\n",
       "       [5.6, 3. , 4.1, 1.3],\n",
       "       [5.5, 2.5, 4. , 1.3],\n",
       "       [5.5, 2.6, 4.4, 1.2],\n",
       "       [6.1, 3. , 4.6, 1.4],\n",
       "       [5.8, 2.6, 4. , 1.2],\n",
       "       [5. , 2.3, 3.3, 1. ],\n",
       "       [5.6, 2.7, 4.2, 1.3],\n",
       "       [5.7, 3. , 4.2, 1.2],\n",
       "       [5.7, 2.9, 4.2, 1.3],\n",
       "       [6.2, 2.9, 4.3, 1.3],\n",
       "       [5.1, 2.5, 3. , 1.1],\n",
       "       [5.7, 2.8, 4.1, 1.3],\n",
       "       [6.3, 3.3, 6. , 2.5],\n",
       "       [5.8, 2.7, 5.1, 1.9],\n",
       "       [7.1, 3. , 5.9, 2.1],\n",
       "       [6.3, 2.9, 5.6, 1.8],\n",
       "       [6.5, 3. , 5.8, 2.2],\n",
       "       [7.6, 3. , 6.6, 2.1],\n",
       "       [4.9, 2.5, 4.5, 1.7],\n",
       "       [7.3, 2.9, 6.3, 1.8],\n",
       "       [6.7, 2.5, 5.8, 1.8],\n",
       "       [7.2, 3.6, 6.1, 2.5],\n",
       "       [6.5, 3.2, 5.1, 2. ],\n",
       "       [6.4, 2.7, 5.3, 1.9],\n",
       "       [6.8, 3. , 5.5, 2.1],\n",
       "       [5.7, 2.5, 5. , 2. ],\n",
       "       [5.8, 2.8, 5.1, 2.4],\n",
       "       [6.4, 3.2, 5.3, 2.3],\n",
       "       [6.5, 3. , 5.5, 1.8],\n",
       "       [7.7, 3.8, 6.7, 2.2],\n",
       "       [7.7, 2.6, 6.9, 2.3],\n",
       "       [6. , 2.2, 5. , 1.5],\n",
       "       [6.9, 3.2, 5.7, 2.3],\n",
       "       [5.6, 2.8, 4.9, 2. ],\n",
       "       [7.7, 2.8, 6.7, 2. ],\n",
       "       [6.3, 2.7, 4.9, 1.8],\n",
       "       [6.7, 3.3, 5.7, 2.1],\n",
       "       [7.2, 3.2, 6. , 1.8],\n",
       "       [6.2, 2.8, 4.8, 1.8],\n",
       "       [6.1, 3. , 4.9, 1.8],\n",
       "       [6.4, 2.8, 5.6, 2.1],\n",
       "       [7.2, 3. , 5.8, 1.6],\n",
       "       [7.4, 2.8, 6.1, 1.9],\n",
       "       [7.9, 3.8, 6.4, 2. ],\n",
       "       [6.4, 2.8, 5.6, 2.2],\n",
       "       [6.3, 2.8, 5.1, 1.5],\n",
       "       [6.1, 2.6, 5.6, 1.4],\n",
       "       [7.7, 3. , 6.1, 2.3],\n",
       "       [6.3, 3.4, 5.6, 2.4],\n",
       "       [6.4, 3.1, 5.5, 1.8],\n",
       "       [6. , 3. , 4.8, 1.8],\n",
       "       [6.9, 3.1, 5.4, 2.1],\n",
       "       [6.7, 3.1, 5.6, 2.4],\n",
       "       [6.9, 3.1, 5.1, 2.3],\n",
       "       [5.8, 2.7, 5.1, 1.9],\n",
       "       [6.8, 3.2, 5.9, 2.3],\n",
       "       [6.7, 3.3, 5.7, 2.5],\n",
       "       [6.7, 3. , 5.2, 2.3],\n",
       "       [6.3, 2.5, 5. , 1.9],\n",
       "       [6.5, 3. , 5.2, 2. ],\n",
       "       [6.2, 3.4, 5.4, 2.3],\n",
       "       [5.9, 3. , 5.1, 1.8]])"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "x"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "id": "20ad65a7",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(150, 4)"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "x.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "id": "08c23cb6",
   "metadata": {},
   "outputs": [
    {
     "ename": "NameError",
     "evalue": "name 'yirrs' is not defined",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mNameError\u001b[0m                                 Traceback (most recent call last)",
      "Cell \u001b[1;32mIn[9], line 1\u001b[0m\n\u001b[1;32m----> 1\u001b[0m \u001b[43myirrs\u001b[49m\n",
      "\u001b[1;31mNameError\u001b[0m: name 'yirrs' is not defined"
     ]
    }
   ],
   "source": [
    "yirrs"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "id": "273a1afb",
   "metadata": {},
   "outputs": [
    {
     "ename": "NameError",
     "evalue": "name 'irrs' is not defined",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mNameError\u001b[0m                                 Traceback (most recent call last)",
      "Cell \u001b[1;32mIn[10], line 1\u001b[0m\n\u001b[1;32m----> 1\u001b[0m \u001b[43mirrs\u001b[49m\n",
      "\u001b[1;31mNameError\u001b[0m: name 'irrs' is not defined"
     ]
    }
   ],
   "source": [
    "irrs"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "id": "5a13e899",
   "metadata": {},
   "outputs": [],
   "source": [
    "y = iris.target"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "id": "808e9bfc",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n",
       "       0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n",
       "       0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n",
       "       1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n",
       "       1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,\n",
       "       2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,\n",
       "       2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2])"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "y"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "id": "3bfde35d",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[5.1, 3.5, 1.4, 0.2],\n",
       "       [4.9, 3. , 1.4, 0.2],\n",
       "       [4.7, 3.2, 1.3, 0.2],\n",
       "       [4.6, 3.1, 1.5, 0.2],\n",
       "       [5. , 3.6, 1.4, 0.2],\n",
       "       [5.4, 3.9, 1.7, 0.4],\n",
       "       [4.6, 3.4, 1.4, 0.3],\n",
       "       [5. , 3.4, 1.5, 0.2],\n",
       "       [4.4, 2.9, 1.4, 0.2],\n",
       "       [4.9, 3.1, 1.5, 0.1],\n",
       "       [5.4, 3.7, 1.5, 0.2],\n",
       "       [4.8, 3.4, 1.6, 0.2],\n",
       "       [4.8, 3. , 1.4, 0.1],\n",
       "       [4.3, 3. , 1.1, 0.1],\n",
       "       [5.8, 4. , 1.2, 0.2],\n",
       "       [5.7, 4.4, 1.5, 0.4],\n",
       "       [5.4, 3.9, 1.3, 0.4],\n",
       "       [5.1, 3.5, 1.4, 0.3],\n",
       "       [5.7, 3.8, 1.7, 0.3],\n",
       "       [5.1, 3.8, 1.5, 0.3],\n",
       "       [5.4, 3.4, 1.7, 0.2],\n",
       "       [5.1, 3.7, 1.5, 0.4],\n",
       "       [4.6, 3.6, 1. , 0.2],\n",
       "       [5.1, 3.3, 1.7, 0.5],\n",
       "       [4.8, 3.4, 1.9, 0.2],\n",
       "       [5. , 3. , 1.6, 0.2],\n",
       "       [5. , 3.4, 1.6, 0.4],\n",
       "       [5.2, 3.5, 1.5, 0.2],\n",
       "       [5.2, 3.4, 1.4, 0.2],\n",
       "       [4.7, 3.2, 1.6, 0.2],\n",
       "       [4.8, 3.1, 1.6, 0.2],\n",
       "       [5.4, 3.4, 1.5, 0.4],\n",
       "       [5.2, 4.1, 1.5, 0.1],\n",
       "       [5.5, 4.2, 1.4, 0.2],\n",
       "       [4.9, 3.1, 1.5, 0.2],\n",
       "       [5. , 3.2, 1.2, 0.2],\n",
       "       [5.5, 3.5, 1.3, 0.2],\n",
       "       [4.9, 3.6, 1.4, 0.1],\n",
       "       [4.4, 3. , 1.3, 0.2],\n",
       "       [5.1, 3.4, 1.5, 0.2],\n",
       "       [5. , 3.5, 1.3, 0.3],\n",
       "       [4.5, 2.3, 1.3, 0.3],\n",
       "       [4.4, 3.2, 1.3, 0.2],\n",
       "       [5. , 3.5, 1.6, 0.6],\n",
       "       [5.1, 3.8, 1.9, 0.4],\n",
       "       [4.8, 3. , 1.4, 0.3],\n",
       "       [5.1, 3.8, 1.6, 0.2],\n",
       "       [4.6, 3.2, 1.4, 0.2],\n",
       "       [5.3, 3.7, 1.5, 0.2],\n",
       "       [5. , 3.3, 1.4, 0.2],\n",
       "       [7. , 3.2, 4.7, 1.4],\n",
       "       [6.4, 3.2, 4.5, 1.5],\n",
       "       [6.9, 3.1, 4.9, 1.5],\n",
       "       [5.5, 2.3, 4. , 1.3],\n",
       "       [6.5, 2.8, 4.6, 1.5],\n",
       "       [5.7, 2.8, 4.5, 1.3],\n",
       "       [6.3, 3.3, 4.7, 1.6],\n",
       "       [4.9, 2.4, 3.3, 1. ],\n",
       "       [6.6, 2.9, 4.6, 1.3],\n",
       "       [5.2, 2.7, 3.9, 1.4],\n",
       "       [5. , 2. , 3.5, 1. ],\n",
       "       [5.9, 3. , 4.2, 1.5],\n",
       "       [6. , 2.2, 4. , 1. ],\n",
       "       [6.1, 2.9, 4.7, 1.4],\n",
       "       [5.6, 2.9, 3.6, 1.3],\n",
       "       [6.7, 3.1, 4.4, 1.4],\n",
       "       [5.6, 3. , 4.5, 1.5],\n",
       "       [5.8, 2.7, 4.1, 1. ],\n",
       "       [6.2, 2.2, 4.5, 1.5],\n",
       "       [5.6, 2.5, 3.9, 1.1],\n",
       "       [5.9, 3.2, 4.8, 1.8],\n",
       "       [6.1, 2.8, 4. , 1.3],\n",
       "       [6.3, 2.5, 4.9, 1.5],\n",
       "       [6.1, 2.8, 4.7, 1.2],\n",
       "       [6.4, 2.9, 4.3, 1.3],\n",
       "       [6.6, 3. , 4.4, 1.4],\n",
       "       [6.8, 2.8, 4.8, 1.4],\n",
       "       [6.7, 3. , 5. , 1.7],\n",
       "       [6. , 2.9, 4.5, 1.5],\n",
       "       [5.7, 2.6, 3.5, 1. ],\n",
       "       [5.5, 2.4, 3.8, 1.1],\n",
       "       [5.5, 2.4, 3.7, 1. ],\n",
       "       [5.8, 2.7, 3.9, 1.2],\n",
       "       [6. , 2.7, 5.1, 1.6],\n",
       "       [5.4, 3. , 4.5, 1.5],\n",
       "       [6. , 3.4, 4.5, 1.6],\n",
       "       [6.7, 3.1, 4.7, 1.5],\n",
       "       [6.3, 2.3, 4.4, 1.3],\n",
       "       [5.6, 3. , 4.1, 1.3],\n",
       "       [5.5, 2.5, 4. , 1.3],\n",
       "       [5.5, 2.6, 4.4, 1.2],\n",
       "       [6.1, 3. , 4.6, 1.4],\n",
       "       [5.8, 2.6, 4. , 1.2],\n",
       "       [5. , 2.3, 3.3, 1. ],\n",
       "       [5.6, 2.7, 4.2, 1.3],\n",
       "       [5.7, 3. , 4.2, 1.2],\n",
       "       [5.7, 2.9, 4.2, 1.3],\n",
       "       [6.2, 2.9, 4.3, 1.3],\n",
       "       [5.1, 2.5, 3. , 1.1],\n",
       "       [5.7, 2.8, 4.1, 1.3],\n",
       "       [6.3, 3.3, 6. , 2.5],\n",
       "       [5.8, 2.7, 5.1, 1.9],\n",
       "       [7.1, 3. , 5.9, 2.1],\n",
       "       [6.3, 2.9, 5.6, 1.8],\n",
       "       [6.5, 3. , 5.8, 2.2],\n",
       "       [7.6, 3. , 6.6, 2.1],\n",
       "       [4.9, 2.5, 4.5, 1.7],\n",
       "       [7.3, 2.9, 6.3, 1.8],\n",
       "       [6.7, 2.5, 5.8, 1.8],\n",
       "       [7.2, 3.6, 6.1, 2.5],\n",
       "       [6.5, 3.2, 5.1, 2. ],\n",
       "       [6.4, 2.7, 5.3, 1.9],\n",
       "       [6.8, 3. , 5.5, 2.1],\n",
       "       [5.7, 2.5, 5. , 2. ],\n",
       "       [5.8, 2.8, 5.1, 2.4],\n",
       "       [6.4, 3.2, 5.3, 2.3],\n",
       "       [6.5, 3. , 5.5, 1.8],\n",
       "       [7.7, 3.8, 6.7, 2.2],\n",
       "       [7.7, 2.6, 6.9, 2.3],\n",
       "       [6. , 2.2, 5. , 1.5],\n",
       "       [6.9, 3.2, 5.7, 2.3],\n",
       "       [5.6, 2.8, 4.9, 2. ],\n",
       "       [7.7, 2.8, 6.7, 2. ],\n",
       "       [6.3, 2.7, 4.9, 1.8],\n",
       "       [6.7, 3.3, 5.7, 2.1],\n",
       "       [7.2, 3.2, 6. , 1.8],\n",
       "       [6.2, 2.8, 4.8, 1.8],\n",
       "       [6.1, 3. , 4.9, 1.8],\n",
       "       [6.4, 2.8, 5.6, 2.1],\n",
       "       [7.2, 3. , 5.8, 1.6],\n",
       "       [7.4, 2.8, 6.1, 1.9],\n",
       "       [7.9, 3.8, 6.4, 2. ],\n",
       "       [6.4, 2.8, 5.6, 2.2],\n",
       "       [6.3, 2.8, 5.1, 1.5],\n",
       "       [6.1, 2.6, 5.6, 1.4],\n",
       "       [7.7, 3. , 6.1, 2.3],\n",
       "       [6.3, 3.4, 5.6, 2.4],\n",
       "       [6.4, 3.1, 5.5, 1.8],\n",
       "       [6. , 3. , 4.8, 1.8],\n",
       "       [6.9, 3.1, 5.4, 2.1],\n",
       "       [6.7, 3.1, 5.6, 2.4],\n",
       "       [6.9, 3.1, 5.1, 2.3],\n",
       "       [5.8, 2.7, 5.1, 1.9],\n",
       "       [6.8, 3.2, 5.9, 2.3],\n",
       "       [6.7, 3.3, 5.7, 2.5],\n",
       "       [6.7, 3. , 5.2, 2.3],\n",
       "       [6.3, 2.5, 5. , 1.9],\n",
       "       [6.5, 3. , 5.2, 2. ],\n",
       "       [6.2, 3.4, 5.4, 2.3],\n",
       "       [5.9, 3. , 5.1, 1.8]])"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "x"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "id": "262995f1",
   "metadata": {},
   "outputs": [
    {
     "ename": "NameError",
     "evalue": "name 'X' is not defined",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mNameError\u001b[0m                                 Traceback (most recent call last)",
      "Cell \u001b[1;32mIn[14], line 1\u001b[0m\n\u001b[1;32m----> 1\u001b[0m X_mean \u001b[38;5;241m=\u001b[39m np\u001b[38;5;241m.\u001b[39mmean(\u001b[43mX\u001b[49m,axis\u001b[38;5;241m=\u001b[39m\u001b[38;5;241m0\u001b[39m)\n",
      "\u001b[1;31mNameError\u001b[0m: name 'X' is not defined"
     ]
    }
   ],
   "source": [
    "X_mean = np.mean(X,axis=0)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "id": "d77ea529",
   "metadata": {},
   "outputs": [],
   "source": [
    "X = iris.data"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "id": "7155364f",
   "metadata": {},
   "outputs": [],
   "source": [
    "X_mean = np.mean(X,axis=0)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "id": "d0c117fc",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([5.84333333, 3.05733333, 3.758     , 1.19933333])"
      ]
     },
     "execution_count": 17,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "X_mean"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "id": "aa81c598",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "3.4644999999999997"
      ]
     },
     "execution_count": 18,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "np.mean(X.T)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "id": "a78e60f4",
   "metadata": {
    "collapsed": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[5.1, 4.9, 4.7, 4.6, 5. , 5.4, 4.6, 5. , 4.4, 4.9, 5.4, 4.8, 4.8,\n",
       "        4.3, 5.8, 5.7, 5.4, 5.1, 5.7, 5.1, 5.4, 5.1, 4.6, 5.1, 4.8, 5. ,\n",
       "        5. , 5.2, 5.2, 4.7, 4.8, 5.4, 5.2, 5.5, 4.9, 5. , 5.5, 4.9, 4.4,\n",
       "        5.1, 5. , 4.5, 4.4, 5. , 5.1, 4.8, 5.1, 4.6, 5.3, 5. , 7. , 6.4,\n",
       "        6.9, 5.5, 6.5, 5.7, 6.3, 4.9, 6.6, 5.2, 5. , 5.9, 6. , 6.1, 5.6,\n",
       "        6.7, 5.6, 5.8, 6.2, 5.6, 5.9, 6.1, 6.3, 6.1, 6.4, 6.6, 6.8, 6.7,\n",
       "        6. , 5.7, 5.5, 5.5, 5.8, 6. , 5.4, 6. , 6.7, 6.3, 5.6, 5.5, 5.5,\n",
       "        6.1, 5.8, 5. , 5.6, 5.7, 5.7, 6.2, 5.1, 5.7, 6.3, 5.8, 7.1, 6.3,\n",
       "        6.5, 7.6, 4.9, 7.3, 6.7, 7.2, 6.5, 6.4, 6.8, 5.7, 5.8, 6.4, 6.5,\n",
       "        7.7, 7.7, 6. , 6.9, 5.6, 7.7, 6.3, 6.7, 7.2, 6.2, 6.1, 6.4, 7.2,\n",
       "        7.4, 7.9, 6.4, 6.3, 6.1, 7.7, 6.3, 6.4, 6. , 6.9, 6.7, 6.9, 5.8,\n",
       "        6.8, 6.7, 6.7, 6.3, 6.5, 6.2, 5.9],\n",
       "       [3.5, 3. , 3.2, 3.1, 3.6, 3.9, 3.4, 3.4, 2.9, 3.1, 3.7, 3.4, 3. ,\n",
       "        3. , 4. , 4.4, 3.9, 3.5, 3.8, 3.8, 3.4, 3.7, 3.6, 3.3, 3.4, 3. ,\n",
       "        3.4, 3.5, 3.4, 3.2, 3.1, 3.4, 4.1, 4.2, 3.1, 3.2, 3.5, 3.6, 3. ,\n",
       "        3.4, 3.5, 2.3, 3.2, 3.5, 3.8, 3. , 3.8, 3.2, 3.7, 3.3, 3.2, 3.2,\n",
       "        3.1, 2.3, 2.8, 2.8, 3.3, 2.4, 2.9, 2.7, 2. , 3. , 2.2, 2.9, 2.9,\n",
       "        3.1, 3. , 2.7, 2.2, 2.5, 3.2, 2.8, 2.5, 2.8, 2.9, 3. , 2.8, 3. ,\n",
       "        2.9, 2.6, 2.4, 2.4, 2.7, 2.7, 3. , 3.4, 3.1, 2.3, 3. , 2.5, 2.6,\n",
       "        3. , 2.6, 2.3, 2.7, 3. , 2.9, 2.9, 2.5, 2.8, 3.3, 2.7, 3. , 2.9,\n",
       "        3. , 3. , 2.5, 2.9, 2.5, 3.6, 3.2, 2.7, 3. , 2.5, 2.8, 3.2, 3. ,\n",
       "        3.8, 2.6, 2.2, 3.2, 2.8, 2.8, 2.7, 3.3, 3.2, 2.8, 3. , 2.8, 3. ,\n",
       "        2.8, 3.8, 2.8, 2.8, 2.6, 3. , 3.4, 3.1, 3. , 3.1, 3.1, 3.1, 2.7,\n",
       "        3.2, 3.3, 3. , 2.5, 3. , 3.4, 3. ],\n",
       "       [1.4, 1.4, 1.3, 1.5, 1.4, 1.7, 1.4, 1.5, 1.4, 1.5, 1.5, 1.6, 1.4,\n",
       "        1.1, 1.2, 1.5, 1.3, 1.4, 1.7, 1.5, 1.7, 1.5, 1. , 1.7, 1.9, 1.6,\n",
       "        1.6, 1.5, 1.4, 1.6, 1.6, 1.5, 1.5, 1.4, 1.5, 1.2, 1.3, 1.4, 1.3,\n",
       "        1.5, 1.3, 1.3, 1.3, 1.6, 1.9, 1.4, 1.6, 1.4, 1.5, 1.4, 4.7, 4.5,\n",
       "        4.9, 4. , 4.6, 4.5, 4.7, 3.3, 4.6, 3.9, 3.5, 4.2, 4. , 4.7, 3.6,\n",
       "        4.4, 4.5, 4.1, 4.5, 3.9, 4.8, 4. , 4.9, 4.7, 4.3, 4.4, 4.8, 5. ,\n",
       "        4.5, 3.5, 3.8, 3.7, 3.9, 5.1, 4.5, 4.5, 4.7, 4.4, 4.1, 4. , 4.4,\n",
       "        4.6, 4. , 3.3, 4.2, 4.2, 4.2, 4.3, 3. , 4.1, 6. , 5.1, 5.9, 5.6,\n",
       "        5.8, 6.6, 4.5, 6.3, 5.8, 6.1, 5.1, 5.3, 5.5, 5. , 5.1, 5.3, 5.5,\n",
       "        6.7, 6.9, 5. , 5.7, 4.9, 6.7, 4.9, 5.7, 6. , 4.8, 4.9, 5.6, 5.8,\n",
       "        6.1, 6.4, 5.6, 5.1, 5.6, 6.1, 5.6, 5.5, 4.8, 5.4, 5.6, 5.1, 5.1,\n",
       "        5.9, 5.7, 5.2, 5. , 5.2, 5.4, 5.1],\n",
       "       [0.2, 0.2, 0.2, 0.2, 0.2, 0.4, 0.3, 0.2, 0.2, 0.1, 0.2, 0.2, 0.1,\n",
       "        0.1, 0.2, 0.4, 0.4, 0.3, 0.3, 0.3, 0.2, 0.4, 0.2, 0.5, 0.2, 0.2,\n",
       "        0.4, 0.2, 0.2, 0.2, 0.2, 0.4, 0.1, 0.2, 0.2, 0.2, 0.2, 0.1, 0.2,\n",
       "        0.2, 0.3, 0.3, 0.2, 0.6, 0.4, 0.3, 0.2, 0.2, 0.2, 0.2, 1.4, 1.5,\n",
       "        1.5, 1.3, 1.5, 1.3, 1.6, 1. , 1.3, 1.4, 1. , 1.5, 1. , 1.4, 1.3,\n",
       "        1.4, 1.5, 1. , 1.5, 1.1, 1.8, 1.3, 1.5, 1.2, 1.3, 1.4, 1.4, 1.7,\n",
       "        1.5, 1. , 1.1, 1. , 1.2, 1.6, 1.5, 1.6, 1.5, 1.3, 1.3, 1.3, 1.2,\n",
       "        1.4, 1.2, 1. , 1.3, 1.2, 1.3, 1.3, 1.1, 1.3, 2.5, 1.9, 2.1, 1.8,\n",
       "        2.2, 2.1, 1.7, 1.8, 1.8, 2.5, 2. , 1.9, 2.1, 2. , 2.4, 2.3, 1.8,\n",
       "        2.2, 2.3, 1.5, 2.3, 2. , 2. , 1.8, 2.1, 1.8, 1.8, 1.8, 2.1, 1.6,\n",
       "        1.9, 2. , 2.2, 1.5, 1.4, 2.3, 2.4, 1.8, 1.8, 2.1, 2.4, 2.3, 1.9,\n",
       "        2.3, 2.5, 2.3, 1.9, 2. , 2.3, 1.8]])"
      ]
     },
     "execution_count": 19,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "X.T"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "id": "666a7411",
   "metadata": {},
   "outputs": [],
   "source": [
    "X_centered = X - X_mean"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "id": "d00a4267",
   "metadata": {},
   "outputs": [],
   "source": [
    "n_samples = X_centered.shape[0]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "id": "12d0d2c8",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "150"
      ]
     },
     "execution_count": 22,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "n_samples"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "id": "55135b66",
   "metadata": {},
   "outputs": [],
   "source": [
    "cov_matrix = (X_centered.T @ X_centered) / (n_samples - 1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "id": "dcfc6108",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[ 0.68569351, -0.042434  ,  1.27431544,  0.51627069],\n",
       "       [-0.042434  ,  0.18997942, -0.32965638, -0.12163937],\n",
       "       [ 1.27431544, -0.32965638,  3.11627785,  1.2956094 ],\n",
       "       [ 0.51627069, -0.12163937,  1.2956094 ,  0.58100626]])"
      ]
     },
     "execution_count": 24,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "cov_matrix"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "id": "315b08bd",
   "metadata": {},
   "outputs": [],
   "source": [
    "cov_matrix_1 = np.cov(X_centered)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "id": "8c5b9c0e",
   "metadata": {
    "collapsed": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[ 1.32069611,  1.08309056,  1.21027389, ..., -0.70495389,\n",
       "        -0.64583167, -0.685415  ],\n",
       "       [ 1.08309056,  0.90131833,  1.00266833, ..., -0.57339278,\n",
       "        -0.52593722, -0.56635389],\n",
       "       [ 1.21027389,  1.00266833,  1.133185  , ..., -0.64537611,\n",
       "        -0.55292056, -0.60250389],\n",
       "       ...,\n",
       "       [-0.70495389, -0.57339278, -0.64537611, ...,  0.37856278,\n",
       "         0.33935167,  0.358935  ],\n",
       "       [-0.64583167, -0.52593722, -0.55292056, ...,  0.33935167,\n",
       "         0.39680722,  0.39805722],\n",
       "       [-0.685415  , -0.56635389, -0.60250389, ...,  0.358935  ,\n",
       "         0.39805722,  0.40847389]])"
      ]
     },
     "execution_count": 26,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "cov_matrix_1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "id": "02f83fd3",
   "metadata": {},
   "outputs": [
    {
     "ename": "TypeError",
     "evalue": "cov() got an unexpected keyword argument 'axis'",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mTypeError\u001b[0m                                 Traceback (most recent call last)",
      "Cell \u001b[1;32mIn[27], line 1\u001b[0m\n\u001b[1;32m----> 1\u001b[0m cov_matrix_1 \u001b[38;5;241m=\u001b[39m \u001b[43mnp\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mcov\u001b[49m\u001b[43m(\u001b[49m\u001b[43mX_centered\u001b[49m\u001b[43m,\u001b[49m\u001b[43maxis\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;241;43m0\u001b[39;49m\u001b[43m)\u001b[49m\n",
      "File \u001b[1;32m<__array_function__ internals>:198\u001b[0m, in \u001b[0;36mcov\u001b[1;34m(*args, **kwargs)\u001b[0m\n",
      "\u001b[1;31mTypeError\u001b[0m: cov() got an unexpected keyword argument 'axis'"
     ]
    }
   ],
   "source": [
    "cov_matrix_1 = np.cov(X_centered,axis=0)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "id": "97206807",
   "metadata": {},
   "outputs": [],
   "source": [
    "cov_matrix_1 = np.cov(X_centered,rowvar=False)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "id": "dc9afd15",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[ 0.68569351, -0.042434  ,  1.27431544,  0.51627069],\n",
       "       [-0.042434  ,  0.18997942, -0.32965638, -0.12163937],\n",
       "       [ 1.27431544, -0.32965638,  3.11627785,  1.2956094 ],\n",
       "       [ 0.51627069, -0.12163937,  1.2956094 ,  0.58100626]])"
      ]
     },
     "execution_count": 29,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "cov_matrix_1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "id": "d788b58c",
   "metadata": {},
   "outputs": [],
   "source": [
    "cov_matrix_1 = np.cov(X_centered.T)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 31,
   "id": "d9346296",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[ 0.68569351, -0.042434  ,  1.27431544,  0.51627069],\n",
       "       [-0.042434  ,  0.18997942, -0.32965638, -0.12163937],\n",
       "       [ 1.27431544, -0.32965638,  3.11627785,  1.2956094 ],\n",
       "       [ 0.51627069, -0.12163937,  1.2956094 ,  0.58100626]])"
      ]
     },
     "execution_count": 31,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "cov_matrix_1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 32,
   "id": "2c023860",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(array([0.02383509, 0.0782095 , 0.24267075, 4.22824171]),\n",
       " array([[ 0.31548719,  0.58202985,  0.65658877, -0.36138659],\n",
       "        [-0.3197231 , -0.59791083,  0.73016143,  0.08452251],\n",
       "        [-0.47983899, -0.07623608, -0.17337266, -0.85667061],\n",
       "        [ 0.75365743, -0.54583143, -0.07548102, -0.3582892 ]]))"
      ]
     },
     "execution_count": 32,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "np.linalg.eigh(cov_matrix)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 33,
   "id": "77fa8f09",
   "metadata": {},
   "outputs": [
    {
     "ename": "SyntaxError",
     "evalue": "invalid character in identifier (322182474.py, line 1)",
     "output_type": "error",
     "traceback": [
      "\u001b[1;36m  Cell \u001b[1;32mIn[33], line 1\u001b[1;36m\u001b[0m\n\u001b[1;33m    cov_matrix。T\u001b[0m\n\u001b[1;37m               ^\u001b[0m\n\u001b[1;31mSyntaxError\u001b[0m\u001b[1;31m:\u001b[0m invalid character in identifier\n"
     ]
    }
   ],
   "source": [
    "cov_matrix。T"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 34,
   "id": "f17ff095",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[ 0.68569351, -0.042434  ,  1.27431544,  0.51627069],\n",
       "       [-0.042434  ,  0.18997942, -0.32965638, -0.12163937],\n",
       "       [ 1.27431544, -0.32965638,  3.11627785,  1.2956094 ],\n",
       "       [ 0.51627069, -0.12163937,  1.2956094 ,  0.58100626]])"
      ]
     },
     "execution_count": 34,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "cov_matrix.T"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 35,
   "id": "e66201ce",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[ 0.68569351, -0.042434  ,  1.27431544,  0.51627069],\n",
       "       [-0.042434  ,  0.18997942, -0.32965638, -0.12163937],\n",
       "       [ 1.27431544, -0.32965638,  3.11627785,  1.2956094 ],\n",
       "       [ 0.51627069, -0.12163937,  1.2956094 ,  0.58100626]])"
      ]
     },
     "execution_count": 35,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "cov_matrix"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 36,
   "id": "2e72b8fd",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 协方差矩阵是一个实对称阵"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "b48eb66b",
   "metadata": {},
   "outputs": [
    {
     "ename": "NameError",
     "evalue": "name 'iris' is not defined",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mNameError\u001b[0m                                 Traceback (most recent call last)",
      "Cell \u001b[1;32mIn[1], line 1\u001b[0m\n\u001b[1;32m----> 1\u001b[0m \u001b[43miris\u001b[49m\n",
      "\u001b[1;31mNameError\u001b[0m: name 'iris' is not defined"
     ]
    }
   ],
   "source": [
    "iris"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "27cd92bc",
   "metadata": {},
   "outputs": [],
   "source": [
    "import numpy as np"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "3277531f",
   "metadata": {},
   "outputs": [],
   "source": [
    "from sklearn.datasets import load_iris"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "73e04225",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 1.加载数据\n",
    "iris = load_iris()\n",
    "X = iris.data\n",
    "y = iris.target"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "e543c9ab",
   "metadata": {
    "collapsed": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[5.1, 3.5, 1.4, 0.2],\n",
       "       [4.9, 3. , 1.4, 0.2],\n",
       "       [4.7, 3.2, 1.3, 0.2],\n",
       "       [4.6, 3.1, 1.5, 0.2],\n",
       "       [5. , 3.6, 1.4, 0.2],\n",
       "       [5.4, 3.9, 1.7, 0.4],\n",
       "       [4.6, 3.4, 1.4, 0.3],\n",
       "       [5. , 3.4, 1.5, 0.2],\n",
       "       [4.4, 2.9, 1.4, 0.2],\n",
       "       [4.9, 3.1, 1.5, 0.1],\n",
       "       [5.4, 3.7, 1.5, 0.2],\n",
       "       [4.8, 3.4, 1.6, 0.2],\n",
       "       [4.8, 3. , 1.4, 0.1],\n",
       "       [4.3, 3. , 1.1, 0.1],\n",
       "       [5.8, 4. , 1.2, 0.2],\n",
       "       [5.7, 4.4, 1.5, 0.4],\n",
       "       [5.4, 3.9, 1.3, 0.4],\n",
       "       [5.1, 3.5, 1.4, 0.3],\n",
       "       [5.7, 3.8, 1.7, 0.3],\n",
       "       [5.1, 3.8, 1.5, 0.3],\n",
       "       [5.4, 3.4, 1.7, 0.2],\n",
       "       [5.1, 3.7, 1.5, 0.4],\n",
       "       [4.6, 3.6, 1. , 0.2],\n",
       "       [5.1, 3.3, 1.7, 0.5],\n",
       "       [4.8, 3.4, 1.9, 0.2],\n",
       "       [5. , 3. , 1.6, 0.2],\n",
       "       [5. , 3.4, 1.6, 0.4],\n",
       "       [5.2, 3.5, 1.5, 0.2],\n",
       "       [5.2, 3.4, 1.4, 0.2],\n",
       "       [4.7, 3.2, 1.6, 0.2],\n",
       "       [4.8, 3.1, 1.6, 0.2],\n",
       "       [5.4, 3.4, 1.5, 0.4],\n",
       "       [5.2, 4.1, 1.5, 0.1],\n",
       "       [5.5, 4.2, 1.4, 0.2],\n",
       "       [4.9, 3.1, 1.5, 0.2],\n",
       "       [5. , 3.2, 1.2, 0.2],\n",
       "       [5.5, 3.5, 1.3, 0.2],\n",
       "       [4.9, 3.6, 1.4, 0.1],\n",
       "       [4.4, 3. , 1.3, 0.2],\n",
       "       [5.1, 3.4, 1.5, 0.2],\n",
       "       [5. , 3.5, 1.3, 0.3],\n",
       "       [4.5, 2.3, 1.3, 0.3],\n",
       "       [4.4, 3.2, 1.3, 0.2],\n",
       "       [5. , 3.5, 1.6, 0.6],\n",
       "       [5.1, 3.8, 1.9, 0.4],\n",
       "       [4.8, 3. , 1.4, 0.3],\n",
       "       [5.1, 3.8, 1.6, 0.2],\n",
       "       [4.6, 3.2, 1.4, 0.2],\n",
       "       [5.3, 3.7, 1.5, 0.2],\n",
       "       [5. , 3.3, 1.4, 0.2],\n",
       "       [7. , 3.2, 4.7, 1.4],\n",
       "       [6.4, 3.2, 4.5, 1.5],\n",
       "       [6.9, 3.1, 4.9, 1.5],\n",
       "       [5.5, 2.3, 4. , 1.3],\n",
       "       [6.5, 2.8, 4.6, 1.5],\n",
       "       [5.7, 2.8, 4.5, 1.3],\n",
       "       [6.3, 3.3, 4.7, 1.6],\n",
       "       [4.9, 2.4, 3.3, 1. ],\n",
       "       [6.6, 2.9, 4.6, 1.3],\n",
       "       [5.2, 2.7, 3.9, 1.4],\n",
       "       [5. , 2. , 3.5, 1. ],\n",
       "       [5.9, 3. , 4.2, 1.5],\n",
       "       [6. , 2.2, 4. , 1. ],\n",
       "       [6.1, 2.9, 4.7, 1.4],\n",
       "       [5.6, 2.9, 3.6, 1.3],\n",
       "       [6.7, 3.1, 4.4, 1.4],\n",
       "       [5.6, 3. , 4.5, 1.5],\n",
       "       [5.8, 2.7, 4.1, 1. ],\n",
       "       [6.2, 2.2, 4.5, 1.5],\n",
       "       [5.6, 2.5, 3.9, 1.1],\n",
       "       [5.9, 3.2, 4.8, 1.8],\n",
       "       [6.1, 2.8, 4. , 1.3],\n",
       "       [6.3, 2.5, 4.9, 1.5],\n",
       "       [6.1, 2.8, 4.7, 1.2],\n",
       "       [6.4, 2.9, 4.3, 1.3],\n",
       "       [6.6, 3. , 4.4, 1.4],\n",
       "       [6.8, 2.8, 4.8, 1.4],\n",
       "       [6.7, 3. , 5. , 1.7],\n",
       "       [6. , 2.9, 4.5, 1.5],\n",
       "       [5.7, 2.6, 3.5, 1. ],\n",
       "       [5.5, 2.4, 3.8, 1.1],\n",
       "       [5.5, 2.4, 3.7, 1. ],\n",
       "       [5.8, 2.7, 3.9, 1.2],\n",
       "       [6. , 2.7, 5.1, 1.6],\n",
       "       [5.4, 3. , 4.5, 1.5],\n",
       "       [6. , 3.4, 4.5, 1.6],\n",
       "       [6.7, 3.1, 4.7, 1.5],\n",
       "       [6.3, 2.3, 4.4, 1.3],\n",
       "       [5.6, 3. , 4.1, 1.3],\n",
       "       [5.5, 2.5, 4. , 1.3],\n",
       "       [5.5, 2.6, 4.4, 1.2],\n",
       "       [6.1, 3. , 4.6, 1.4],\n",
       "       [5.8, 2.6, 4. , 1.2],\n",
       "       [5. , 2.3, 3.3, 1. ],\n",
       "       [5.6, 2.7, 4.2, 1.3],\n",
       "       [5.7, 3. , 4.2, 1.2],\n",
       "       [5.7, 2.9, 4.2, 1.3],\n",
       "       [6.2, 2.9, 4.3, 1.3],\n",
       "       [5.1, 2.5, 3. , 1.1],\n",
       "       [5.7, 2.8, 4.1, 1.3],\n",
       "       [6.3, 3.3, 6. , 2.5],\n",
       "       [5.8, 2.7, 5.1, 1.9],\n",
       "       [7.1, 3. , 5.9, 2.1],\n",
       "       [6.3, 2.9, 5.6, 1.8],\n",
       "       [6.5, 3. , 5.8, 2.2],\n",
       "       [7.6, 3. , 6.6, 2.1],\n",
       "       [4.9, 2.5, 4.5, 1.7],\n",
       "       [7.3, 2.9, 6.3, 1.8],\n",
       "       [6.7, 2.5, 5.8, 1.8],\n",
       "       [7.2, 3.6, 6.1, 2.5],\n",
       "       [6.5, 3.2, 5.1, 2. ],\n",
       "       [6.4, 2.7, 5.3, 1.9],\n",
       "       [6.8, 3. , 5.5, 2.1],\n",
       "       [5.7, 2.5, 5. , 2. ],\n",
       "       [5.8, 2.8, 5.1, 2.4],\n",
       "       [6.4, 3.2, 5.3, 2.3],\n",
       "       [6.5, 3. , 5.5, 1.8],\n",
       "       [7.7, 3.8, 6.7, 2.2],\n",
       "       [7.7, 2.6, 6.9, 2.3],\n",
       "       [6. , 2.2, 5. , 1.5],\n",
       "       [6.9, 3.2, 5.7, 2.3],\n",
       "       [5.6, 2.8, 4.9, 2. ],\n",
       "       [7.7, 2.8, 6.7, 2. ],\n",
       "       [6.3, 2.7, 4.9, 1.8],\n",
       "       [6.7, 3.3, 5.7, 2.1],\n",
       "       [7.2, 3.2, 6. , 1.8],\n",
       "       [6.2, 2.8, 4.8, 1.8],\n",
       "       [6.1, 3. , 4.9, 1.8],\n",
       "       [6.4, 2.8, 5.6, 2.1],\n",
       "       [7.2, 3. , 5.8, 1.6],\n",
       "       [7.4, 2.8, 6.1, 1.9],\n",
       "       [7.9, 3.8, 6.4, 2. ],\n",
       "       [6.4, 2.8, 5.6, 2.2],\n",
       "       [6.3, 2.8, 5.1, 1.5],\n",
       "       [6.1, 2.6, 5.6, 1.4],\n",
       "       [7.7, 3. , 6.1, 2.3],\n",
       "       [6.3, 3.4, 5.6, 2.4],\n",
       "       [6.4, 3.1, 5.5, 1.8],\n",
       "       [6. , 3. , 4.8, 1.8],\n",
       "       [6.9, 3.1, 5.4, 2.1],\n",
       "       [6.7, 3.1, 5.6, 2.4],\n",
       "       [6.9, 3.1, 5.1, 2.3],\n",
       "       [5.8, 2.7, 5.1, 1.9],\n",
       "       [6.8, 3.2, 5.9, 2.3],\n",
       "       [6.7, 3.3, 5.7, 2.5],\n",
       "       [6.7, 3. , 5.2, 2.3],\n",
       "       [6.3, 2.5, 5. , 1.9],\n",
       "       [6.5, 3. , 5.2, 2. ],\n",
       "       [6.2, 3.4, 5.4, 2.3],\n",
       "       [5.9, 3. , 5.1, 1.8]])"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "X"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "ba3390c2",
   "metadata": {},
   "outputs": [],
   "source": [
    "X_mean = np.mean(X, axis=1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "id": "4a14b601",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([2.55 , 2.375, 2.35 , 2.35 , 2.55 , 2.85 , 2.425, 2.525, 2.225,\n",
       "       2.4  , 2.7  , 2.5  , 2.325, 2.125, 2.8  , 3.   , 2.75 , 2.575,\n",
       "       2.875, 2.675, 2.675, 2.675, 2.35 , 2.65 , 2.575, 2.45 , 2.6  ,\n",
       "       2.6  , 2.55 , 2.425, 2.425, 2.675, 2.725, 2.825, 2.425, 2.4  ,\n",
       "       2.625, 2.5  , 2.225, 2.55 , 2.525, 2.1  , 2.275, 2.675, 2.8  ,\n",
       "       2.375, 2.675, 2.35 , 2.675, 2.475, 4.075, 3.9  , 4.1  , 3.275,\n",
       "       3.85 , 3.575, 3.975, 2.9  , 3.85 , 3.3  , 2.875, 3.65 , 3.3  ,\n",
       "       3.775, 3.35 , 3.9  , 3.65 , 3.4  , 3.6  , 3.275, 3.925, 3.55 ,\n",
       "       3.8  , 3.7  , 3.725, 3.85 , 3.95 , 4.1  , 3.725, 3.2  , 3.2  ,\n",
       "       3.15 , 3.4  , 3.85 , 3.6  , 3.875, 4.   , 3.575, 3.5  , 3.325,\n",
       "       3.425, 3.775, 3.4  , 2.9  , 3.45 , 3.525, 3.525, 3.675, 2.925,\n",
       "       3.475, 4.525, 3.875, 4.525, 4.15 , 4.375, 4.825, 3.4  , 4.575,\n",
       "       4.2  , 4.85 , 4.2  , 4.075, 4.35 , 3.8  , 4.025, 4.3  , 4.2  ,\n",
       "       5.1  , 4.875, 3.675, 4.525, 3.825, 4.8  , 3.925, 4.45 , 4.55 ,\n",
       "       3.9  , 3.95 , 4.225, 4.4  , 4.55 , 5.025, 4.25 , 3.925, 3.925,\n",
       "       4.775, 4.425, 4.2  , 3.9  , 4.375, 4.45 , 4.35 , 3.875, 4.55 ,\n",
       "       4.55 , 4.3  , 3.925, 4.175, 4.325, 3.95 ])"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "X_mean"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "id": "dbe6da4c",
   "metadata": {},
   "outputs": [],
   "source": [
    "X_mean = np.mean(X,axis=0)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "id": "5e93c091",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([5.84333333, 3.05733333, 3.758     , 1.19933333])"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "X_mean"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "id": "28a554e3",
   "metadata": {},
   "outputs": [],
   "source": [
    "X_centered = X - X_mean"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "id": "09c2a216",
   "metadata": {},
   "outputs": [],
   "source": [
    "cov_matrix = np.cov(X_centered,rowvar=False)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "id": "544ea74f",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[ 0.68569351, -0.042434  ,  1.27431544,  0.51627069],\n",
       "       [-0.042434  ,  0.18997942, -0.32965638, -0.12163937],\n",
       "       [ 1.27431544, -0.32965638,  3.11627785,  1.2956094 ],\n",
       "       [ 0.51627069, -0.12163937,  1.2956094 ,  0.58100626]])"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "cov_matrix"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "id": "28573be9",
   "metadata": {
    "collapsed": true
   },
   "outputs": [
    {
     "ename": "AttributeError",
     "evalue": "module 'numpy' has no attribute 'linalge'",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mAttributeError\u001b[0m                            Traceback (most recent call last)",
      "Cell \u001b[1;32mIn[13], line 1\u001b[0m\n\u001b[1;32m----> 1\u001b[0m eig_vals, eig_vecs \u001b[38;5;241m=\u001b[39m \u001b[43mnp\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mlinalge\u001b[49m\u001b[38;5;241m.\u001b[39meigh(cov_matrix)\n",
      "File \u001b[1;32mD:\\miniconda3\\envs\\pydata-book\\lib\\site-packages\\numpy\\__init__.py:320\u001b[0m, in \u001b[0;36m__getattr__\u001b[1;34m(attr)\u001b[0m\n\u001b[0;32m    317\u001b[0m     \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01mtesting\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m Tester\n\u001b[0;32m    318\u001b[0m     \u001b[38;5;28;01mreturn\u001b[39;00m Tester\n\u001b[1;32m--> 320\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;167;01mAttributeError\u001b[39;00m(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mmodule \u001b[39m\u001b[38;5;132;01m{!r}\u001b[39;00m\u001b[38;5;124m has no attribute \u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[0;32m    321\u001b[0m                      \u001b[38;5;124m\"\u001b[39m\u001b[38;5;132;01m{!r}\u001b[39;00m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;241m.\u001b[39mformat(\u001b[38;5;18m__name__\u001b[39m, attr))\n",
      "\u001b[1;31mAttributeError\u001b[0m: module 'numpy' has no attribute 'linalge'"
     ]
    }
   ],
   "source": [
    "eig_vals, eig_vecs = np.linalge.eigh(cov_matrix)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "id": "e8f01f33",
   "metadata": {},
   "outputs": [],
   "source": [
    "eig_vals, eig_vecs = np.linalg.eigh(cov_matrix)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "id": "43eb5eb4",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([0.02383509, 0.0782095 , 0.24267075, 4.22824171])"
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "eig_vals"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "id": "adb17018",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[ 0.31548719,  0.58202985,  0.65658877, -0.36138659],\n",
       "       [-0.3197231 , -0.59791083,  0.73016143,  0.08452251],\n",
       "       [-0.47983899, -0.07623608, -0.17337266, -0.85667061],\n",
       "       [ 0.75365743, -0.54583143, -0.07548102, -0.3582892 ]])"
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "eig_vecs"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "id": "d90bbef2",
   "metadata": {},
   "outputs": [
    {
     "ename": "NameError",
     "evalue": "name 'eig' is not defined",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mNameError\u001b[0m                                 Traceback (most recent call last)",
      "Cell \u001b[1;32mIn[17], line 2\u001b[0m\n\u001b[0;32m      1\u001b[0m \u001b[38;5;66;03m# 特征值 、特征向量 \u001b[39;00m\n\u001b[1;32m----> 2\u001b[0m sorted_idx \u001b[38;5;241m=\u001b[39m np\u001b[38;5;241m.\u001b[39margsort(\u001b[43meig\u001b[49m)\n",
      "\u001b[1;31mNameError\u001b[0m: name 'eig' is not defined"
     ]
    }
   ],
   "source": [
    "# 特征值 、特征向量 \n",
    "sorted_idx = np.argsort(eig)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "id": "541c27d0",
   "metadata": {},
   "outputs": [],
   "source": [
    "sorted_idx = np.argsort(eig_vals)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "id": "f83ef685",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([0, 1, 2, 3], dtype=int64)"
      ]
     },
     "execution_count": 19,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "sorted_idx"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "id": "4192a123",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([3, 2, 1, 0], dtype=int64)"
      ]
     },
     "execution_count": 20,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "np.argsort(eig_vals)[::-1]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "id": "beb51976",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "numpy.ndarray"
      ]
     },
     "execution_count": 21,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "type(sorted_idx)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "id": "8d6a9dea",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(4,)"
      ]
     },
     "execution_count": 22,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "sorted_idx.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "id": "ed7a1f11",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([0.02383509, 0.0782095 , 0.24267075, 4.22824171])"
      ]
     },
     "execution_count": 23,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "eig_vals"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "id": "9eacb047",
   "metadata": {},
   "outputs": [],
   "source": [
    "sorted_idx = np.argsort(eig_vals)[::-1]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "id": "99cfa8e1",
   "metadata": {},
   "outputs": [],
   "source": [
    "eig_vals = eig_vals[sorted_idx]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "id": "e80a9b2f",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([4.22824171, 0.24267075, 0.0782095 , 0.02383509])"
      ]
     },
     "execution_count": 26,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "eig_vals"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "id": "83c97cb4",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[ 0.31548719,  0.58202985,  0.65658877, -0.36138659],\n",
       "       [-0.3197231 , -0.59791083,  0.73016143,  0.08452251],\n",
       "       [-0.47983899, -0.07623608, -0.17337266, -0.85667061],\n",
       "       [ 0.75365743, -0.54583143, -0.07548102, -0.3582892 ]])"
      ]
     },
     "execution_count": 27,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "eig_vecs"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "id": "250f249b",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(4, 4)"
      ]
     },
     "execution_count": 28,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "eig_vecs.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "id": "c1aa913c",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "numpy.ndarray"
      ]
     },
     "execution_count": 29,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "type(eig_vecs)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "id": "2577cde1",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "numpy.ndarray"
      ]
     },
     "execution_count": 30,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "type(eig_vals)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 31,
   "id": "2e14dc3e",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([-0.3197231 , -0.59791083,  0.73016143,  0.08452251])"
      ]
     },
     "execution_count": 31,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "eig_vecs[1]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 32,
   "id": "aa8ceda1",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[ 0.31548719,  0.58202985,  0.65658877, -0.36138659],\n",
       "       [-0.3197231 , -0.59791083,  0.73016143,  0.08452251],\n",
       "       [-0.47983899, -0.07623608, -0.17337266, -0.85667061],\n",
       "       [ 0.75365743, -0.54583143, -0.07548102, -0.3582892 ]])"
      ]
     },
     "execution_count": 32,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "eig_vecs"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 33,
   "id": "5cd7f9f9",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[ 0.31548719,  0.58202985,  0.65658877, -0.36138659],\n",
       "       [-0.3197231 , -0.59791083,  0.73016143,  0.08452251],\n",
       "       [-0.47983899, -0.07623608, -0.17337266, -0.85667061],\n",
       "       [ 0.75365743, -0.54583143, -0.07548102, -0.3582892 ]])"
      ]
     },
     "execution_count": 33,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "eig_vecs[:]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 34,
   "id": "f238f546",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([ 0.58202985, -0.59791083, -0.07623608, -0.54583143])"
      ]
     },
     "execution_count": 34,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "eig_vecs[:,1]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 35,
   "id": "7323ad09",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([ 0.58202985, -0.59791083, -0.07623608, -0.54583143])"
      ]
     },
     "execution_count": 35,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "eig_vecs[:,1].T"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 36,
   "id": "6082661a",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[-0.36138659,  0.65658877,  0.58202985,  0.31548719],\n",
       "       [ 0.08452251,  0.73016143, -0.59791083, -0.3197231 ],\n",
       "       [-0.85667061, -0.17337266, -0.07623608, -0.47983899],\n",
       "       [-0.3582892 , -0.07548102, -0.54583143,  0.75365743]])"
      ]
     },
     "execution_count": 36,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "eig_vecs[:,sorted_idx]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 37,
   "id": "728b4831",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([3, 2, 1, 0], dtype=int64)"
      ]
     },
     "execution_count": 37,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "sorted_idx"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 38,
   "id": "47b58e35",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([-0.3197231 , -0.59791083,  0.73016143,  0.08452251])"
      ]
     },
     "execution_count": 38,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "eig_vecs[1]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 39,
   "id": "7dc5c5d9",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0.7301614347850244"
      ]
     },
     "execution_count": 39,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "eig_vecs[1,2]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 40,
   "id": "69d4c294",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[ 0.31548719,  0.58202985,  0.65658877, -0.36138659],\n",
       "       [-0.3197231 , -0.59791083,  0.73016143,  0.08452251],\n",
       "       [-0.47983899, -0.07623608, -0.17337266, -0.85667061],\n",
       "       [ 0.75365743, -0.54583143, -0.07548102, -0.3582892 ]])"
      ]
     },
     "execution_count": 40,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "eig_vecs"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 41,
   "id": "95fa9a4e",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[ 0.31548719,  0.58202985,  0.65658877, -0.36138659],\n",
       "       [-0.3197231 , -0.59791083,  0.73016143,  0.08452251]])"
      ]
     },
     "execution_count": 41,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "eig_vecs[:2]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 42,
   "id": "12a19881",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[ 0.58202985,  0.65658877, -0.36138659],\n",
       "       [-0.59791083,  0.73016143,  0.08452251]])"
      ]
     },
     "execution_count": 42,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "eig_vecs[:2,1:]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 43,
   "id": "c43ce055",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[ 0.31548719],\n",
       "       [-0.3197231 ],\n",
       "       [-0.47983899],\n",
       "       [ 0.75365743]])"
      ]
     },
     "execution_count": 43,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "eig_vecs[:,:1]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 44,
   "id": "2fffe577",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(array([4.22824171, 0.24267075, 0.0782095 , 0.02383509]),\n",
       " array([[ 0.31548719,  0.58202985,  0.65658877, -0.36138659],\n",
       "        [-0.3197231 , -0.59791083,  0.73016143,  0.08452251],\n",
       "        [-0.47983899, -0.07623608, -0.17337266, -0.85667061],\n",
       "        [ 0.75365743, -0.54583143, -0.07548102, -0.3582892 ]]))"
      ]
     },
     "execution_count": 44,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "eig_vals,eig_vecs"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 45,
   "id": "d5e430eb",
   "metadata": {},
   "outputs": [],
   "source": [
    "k=2\n",
    "W = eig_vecs[:,:k]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 46,
   "id": "c7b23511",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[ 0.31548719,  0.58202985],\n",
       "       [-0.3197231 , -0.59791083],\n",
       "       [-0.47983899, -0.07623608],\n",
       "       [ 0.75365743, -0.54583143]])"
      ]
     },
     "execution_count": 46,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "W"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 47,
   "id": "b9d72258",
   "metadata": {},
   "outputs": [],
   "source": [
    "X_pac = X_centered.dot(W)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 48,
   "id": "12fb3a6c",
   "metadata": {
    "collapsed": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[ 2.26243707e-03,  2.79148276e-02],\n",
       "       [ 9.90265503e-02,  2.10464272e-01],\n",
       "       [ 1.99683897e-02, -1.79002563e-02],\n",
       "       [-7.55758166e-02, -3.15593736e-02],\n",
       "       [-6.12585926e-02, -9.00792406e-02],\n",
       "       [-2.42008576e-02, -1.68677658e-01],\n",
       "       [-4.81431065e-02, -2.57892158e-01],\n",
       "       [-4.52978706e-02,  2.18793179e-02],\n",
       "       [-2.67447358e-02, -2.07595703e-02],\n",
       "       [-5.62954013e-02,  1.97632725e-01],\n",
       "       [-1.50199245e-02,  7.53180094e-02],\n",
       "       [-1.56379208e-01, -1.02150260e-01],\n",
       "       [-7.88791149e-03,  2.06844430e-01],\n",
       "       [-2.16798118e-02, -6.12996725e-02],\n",
       "       [ 1.59209718e-01,  1.51627524e-01],\n",
       "       [ 6.55154587e-03, -2.77776903e-01],\n",
       "       [ 1.67734737e-01, -1.38183228e-01],\n",
       "       [ 7.76281796e-02, -2.66683156e-02],\n",
       "       [ 2.70518681e-02,  1.20305523e-01],\n",
       "       [-6.62726502e-02, -2.13665172e-01],\n",
       "       [-1.50707908e-02,  2.39444043e-01],\n",
       "       [ 4.10654027e-02, -2.08457232e-01],\n",
       "       [ 4.48212505e-03, -2.92396751e-01],\n",
       "       [ 1.48352589e-01, -3.91232587e-02],\n",
       "       [-3.00330904e-01, -1.25021083e-01],\n",
       "       [ 3.46074722e-02,  2.53420042e-01],\n",
       "       [ 5.74497158e-02, -9.49105761e-02],\n",
       "       [-1.41727423e-02,  7.84942051e-02],\n",
       "       [ 6.57834667e-02,  1.45908896e-01],\n",
       "       [-1.23983306e-01, -4.07710791e-02],\n",
       "       [-6.04622767e-02,  7.72229891e-02],\n",
       "       [ 2.31628492e-01,  1.45524972e-01],\n",
       "       [-2.81372347e-01, -2.25669150e-01],\n",
       "       [-9.53488583e-02, -1.57810813e-01],\n",
       "       [ 1.90703413e-02,  1.43049582e-01],\n",
       "       [ 1.62598446e-01,  1.64332307e-01],\n",
       "       [ 1.76441213e-01,  2.68350376e-01],\n",
       "       [-1.68173054e-01, -9.36990825e-02],\n",
       "       [-1.07331474e-02, -7.29270457e-02],\n",
       "       [-1.37491513e-02,  8.00823030e-02],\n",
       "       [ 9.40633590e-02, -7.72476932e-02],\n",
       "       [ 3.19987487e-01,  3.49230377e-01],\n",
       "       [-7.46777682e-02, -1.92509212e-01],\n",
       "       [ 1.76208890e-01, -2.63867946e-01],\n",
       "       [-1.82842502e-01, -2.98742746e-01],\n",
       "       [ 1.42843574e-01,  9.76781440e-02],\n",
       "       [-1.89622291e-01, -1.66705637e-01],\n",
       "       [-5.95642283e-02, -8.37268490e-02],\n",
       "       [-4.65686438e-02,  1.71150242e-02],\n",
       "       [ 3.46583385e-02,  8.92940085e-02],\n",
       "       [ 1.85252879e-02,  4.06568025e-01],\n",
       "       [ 5.66512106e-04,  1.80141866e-02],\n",
       "       [-1.65317587e-03,  3.38325765e-01],\n",
       "       [ 9.35668402e-02,  1.79591392e-01],\n",
       "       [ 1.12020574e-01,  3.07757896e-01],\n",
       "       [-2.43116767e-01, -4.10760908e-02],\n",
       "       [-8.35565724e-02, -1.69810240e-01],\n",
       "       [-1.79077226e-02, -1.23029192e-02],\n",
       "       [-3.91345020e-02,  4.15336085e-01],\n",
       "       [-5.61891788e-03, -2.81141431e-01],\n",
       "       [ 4.55624408e-02,  2.69817183e-01],\n",
       "       [ 5.07192325e-02, -1.30547750e-01],\n",
       "       [ 5.71855195e-02,  6.94146830e-01],\n",
       "       [-1.69496255e-01,  6.21144083e-02],\n",
       "       [ 1.25217292e-01, -9.04576907e-02],\n",
       "       [ 9.98031365e-02,  3.14620976e-01],\n",
       "       [-1.87878621e-01, -3.28027528e-01],\n",
       "       [-2.13757370e-01,  2.71161837e-01],\n",
       "       [ 2.57192177e-01,  4.99519046e-01],\n",
       "       [-4.15766476e-02,  2.35002105e-01],\n",
       "       [-7.50315529e-02, -4.59620991e-01],\n",
       "       [ 1.22997604e-01,  2.29853888e-01],\n",
       "       [ 8.88370584e-04,  3.47854352e-01],\n",
       "       [-2.88255429e-01,  2.31071778e-01],\n",
       "       [ 4.17197556e-02,  3.21800937e-01],\n",
       "       [ 1.00226728e-01,  3.16209074e-01],\n",
       "       [ 3.53331921e-02,  5.21702780e-01],\n",
       "       [ 6.99692823e-02,  1.64920984e-01],\n",
       "       [-2.97114340e-02, -3.54245048e-02],\n",
       "       [ 7.45696136e-02,  3.18491581e-01],\n",
       "       [ 6.83084222e-03,  2.44213810e-01],\n",
       "       [-2.05510016e-02,  3.06420561e-01],\n",
       "       [ 3.29419128e-02,  1.77242766e-01],\n",
       "       [-1.78304463e-01, -1.61671275e-02],\n",
       "       [-2.50976060e-01, -4.44433499e-01],\n",
       "       [-1.14207243e-01, -3.88963063e-01],\n",
       "       [ 3.12171829e-02,  2.37167010e-01],\n",
       "       [ 1.54021000e-01,  6.14720843e-01],\n",
       "       [-1.46674512e-01, -1.88366812e-01],\n",
       "       [ 2.96222195e-02,  6.00092259e-02],\n",
       "       [-2.69651428e-01,  2.43068557e-02],\n",
       "       [-1.53484666e-01,  9.94693289e-03],\n",
       "       [ 1.69303245e-02,  2.29410241e-01],\n",
       "       [ 4.56133071e-02,  1.05691149e-01],\n",
       "       [-9.87414793e-02, -1.66171702e-02],\n",
       "       [-2.38475434e-01, -8.32042909e-02],\n",
       "       [-1.31137381e-01, -7.79963511e-02],\n",
       "       [-2.13776830e-02,  2.05394967e-01],\n",
       "       [ 2.32534844e-01,  1.25996476e-02],\n",
       "       [-5.11811717e-02, -1.05816605e-02],\n",
       "       [-2.90555728e-02, -7.60165427e-01],\n",
       "       [-1.53046739e-02, -2.96322527e-01],\n",
       "       [ 6.57720412e-02,  1.10787883e-01],\n",
       "       [-2.36790934e-01, -1.08424662e-01],\n",
       "       [-1.70633278e-04, -2.85389563e-01],\n",
       "       [-1.12371653e-01,  3.48437556e-01],\n",
       "       [-9.81266196e-02, -5.45659296e-01],\n",
       "       [-2.57191032e-01,  4.20239936e-01],\n",
       "       [-7.86746130e-02,  3.48304395e-01],\n",
       "       [ 1.10982071e-01, -4.23335418e-01],\n",
       "       [ 1.21040552e-01, -2.42440190e-01],\n",
       "       [ 7.80198444e-02,  3.76481682e-02],\n",
       "       [ 1.63061478e-01, -3.33266418e-02],\n",
       "       [ 1.40440869e-01, -2.81902882e-01],\n",
       "       [ 3.29551728e-01, -6.29029326e-01],\n",
       "       [ 2.19621263e-01, -4.79639820e-01],\n",
       "       [-1.57681907e-01, -4.41861676e-02],\n",
       "       [-3.09219573e-01, -1.33894874e-01],\n",
       "       [ 5.38460965e-02,  5.13767764e-01],\n",
       "       [-4.58247549e-02,  3.44995038e-01],\n",
       "       [ 1.85429264e-01, -2.19119324e-01],\n",
       "       [ 6.09591171e-02, -5.11855509e-01],\n",
       "       [-1.40227954e-01,  5.73182243e-01],\n",
       "       [ 1.63040977e-01,  6.45227566e-02],\n",
       "       [-6.03719696e-02, -2.86150091e-01],\n",
       "       [-2.40704986e-01,  2.05534524e-01],\n",
       "       [ 1.47503846e-01, -4.58477039e-02],\n",
       "       [ 4.02660775e-03, -2.31256463e-01],\n",
       "       [ 5.28273230e-02, -1.54180024e-01],\n",
       "       [-2.31524053e-01,  4.49530192e-01],\n",
       "       [-2.23364626e-02,  4.98898076e-01],\n",
       "       [-2.52901923e-01,  1.14548205e-01],\n",
       "       [ 1.28193066e-01, -2.08763167e-01],\n",
       "       [-1.90996358e-01,  1.53233888e-01],\n",
       "       [-5.05434412e-01,  1.72875189e-01],\n",
       "       [ 3.09828045e-01,  3.35592292e-01],\n",
       "       [ 5.55419691e-02, -7.34878937e-01],\n",
       "       [-2.21202937e-01, -1.62180236e-01],\n",
       "       [ 2.04617872e-02, -2.81835840e-01],\n",
       "       [ 2.10621786e-01, -2.72911321e-02],\n",
       "       [ 2.77653777e-01, -3.22693747e-01],\n",
       "       [ 5.05304967e-01, -1.13586596e-01],\n",
       "       [-1.53046739e-02, -2.96322527e-01],\n",
       "       [ 5.79127477e-02, -2.92569525e-01],\n",
       "       [ 2.41091000e-01, -5.04482664e-01],\n",
       "       [ 4.26195940e-01, -1.77825091e-01],\n",
       "       [ 2.54367442e-01,  1.21898172e-01],\n",
       "       [ 1.37001274e-01, -1.30481631e-01],\n",
       "       [ 4.45953047e-02, -7.23251563e-01],\n",
       "       [-1.55038628e-01, -3.62909648e-01]])"
      ]
     },
     "execution_count": 48,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "X_pac"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 49,
   "id": "239dcb5c",
   "metadata": {},
   "outputs": [],
   "source": [
    "X_pac = X_centered @ W"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 50,
   "id": "0a7e395b",
   "metadata": {
    "collapsed": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[ 2.26243707e-03,  2.79148276e-02],\n",
       "       [ 9.90265503e-02,  2.10464272e-01],\n",
       "       [ 1.99683897e-02, -1.79002563e-02],\n",
       "       [-7.55758166e-02, -3.15593736e-02],\n",
       "       [-6.12585926e-02, -9.00792406e-02],\n",
       "       [-2.42008576e-02, -1.68677658e-01],\n",
       "       [-4.81431065e-02, -2.57892158e-01],\n",
       "       [-4.52978706e-02,  2.18793179e-02],\n",
       "       [-2.67447358e-02, -2.07595703e-02],\n",
       "       [-5.62954013e-02,  1.97632725e-01],\n",
       "       [-1.50199245e-02,  7.53180094e-02],\n",
       "       [-1.56379208e-01, -1.02150260e-01],\n",
       "       [-7.88791149e-03,  2.06844430e-01],\n",
       "       [-2.16798118e-02, -6.12996725e-02],\n",
       "       [ 1.59209718e-01,  1.51627524e-01],\n",
       "       [ 6.55154587e-03, -2.77776903e-01],\n",
       "       [ 1.67734737e-01, -1.38183228e-01],\n",
       "       [ 7.76281796e-02, -2.66683156e-02],\n",
       "       [ 2.70518681e-02,  1.20305523e-01],\n",
       "       [-6.62726502e-02, -2.13665172e-01],\n",
       "       [-1.50707908e-02,  2.39444043e-01],\n",
       "       [ 4.10654027e-02, -2.08457232e-01],\n",
       "       [ 4.48212505e-03, -2.92396751e-01],\n",
       "       [ 1.48352589e-01, -3.91232587e-02],\n",
       "       [-3.00330904e-01, -1.25021083e-01],\n",
       "       [ 3.46074722e-02,  2.53420042e-01],\n",
       "       [ 5.74497158e-02, -9.49105761e-02],\n",
       "       [-1.41727423e-02,  7.84942051e-02],\n",
       "       [ 6.57834667e-02,  1.45908896e-01],\n",
       "       [-1.23983306e-01, -4.07710791e-02],\n",
       "       [-6.04622767e-02,  7.72229891e-02],\n",
       "       [ 2.31628492e-01,  1.45524972e-01],\n",
       "       [-2.81372347e-01, -2.25669150e-01],\n",
       "       [-9.53488583e-02, -1.57810813e-01],\n",
       "       [ 1.90703413e-02,  1.43049582e-01],\n",
       "       [ 1.62598446e-01,  1.64332307e-01],\n",
       "       [ 1.76441213e-01,  2.68350376e-01],\n",
       "       [-1.68173054e-01, -9.36990825e-02],\n",
       "       [-1.07331474e-02, -7.29270457e-02],\n",
       "       [-1.37491513e-02,  8.00823030e-02],\n",
       "       [ 9.40633590e-02, -7.72476932e-02],\n",
       "       [ 3.19987487e-01,  3.49230377e-01],\n",
       "       [-7.46777682e-02, -1.92509212e-01],\n",
       "       [ 1.76208890e-01, -2.63867946e-01],\n",
       "       [-1.82842502e-01, -2.98742746e-01],\n",
       "       [ 1.42843574e-01,  9.76781440e-02],\n",
       "       [-1.89622291e-01, -1.66705637e-01],\n",
       "       [-5.95642283e-02, -8.37268490e-02],\n",
       "       [-4.65686438e-02,  1.71150242e-02],\n",
       "       [ 3.46583385e-02,  8.92940085e-02],\n",
       "       [ 1.85252879e-02,  4.06568025e-01],\n",
       "       [ 5.66512106e-04,  1.80141866e-02],\n",
       "       [-1.65317587e-03,  3.38325765e-01],\n",
       "       [ 9.35668402e-02,  1.79591392e-01],\n",
       "       [ 1.12020574e-01,  3.07757896e-01],\n",
       "       [-2.43116767e-01, -4.10760908e-02],\n",
       "       [-8.35565724e-02, -1.69810240e-01],\n",
       "       [-1.79077226e-02, -1.23029192e-02],\n",
       "       [-3.91345020e-02,  4.15336085e-01],\n",
       "       [-5.61891788e-03, -2.81141431e-01],\n",
       "       [ 4.55624408e-02,  2.69817183e-01],\n",
       "       [ 5.07192325e-02, -1.30547750e-01],\n",
       "       [ 5.71855195e-02,  6.94146830e-01],\n",
       "       [-1.69496255e-01,  6.21144083e-02],\n",
       "       [ 1.25217292e-01, -9.04576907e-02],\n",
       "       [ 9.98031365e-02,  3.14620976e-01],\n",
       "       [-1.87878621e-01, -3.28027528e-01],\n",
       "       [-2.13757370e-01,  2.71161837e-01],\n",
       "       [ 2.57192177e-01,  4.99519046e-01],\n",
       "       [-4.15766476e-02,  2.35002105e-01],\n",
       "       [-7.50315529e-02, -4.59620991e-01],\n",
       "       [ 1.22997604e-01,  2.29853888e-01],\n",
       "       [ 8.88370584e-04,  3.47854352e-01],\n",
       "       [-2.88255429e-01,  2.31071778e-01],\n",
       "       [ 4.17197556e-02,  3.21800937e-01],\n",
       "       [ 1.00226728e-01,  3.16209074e-01],\n",
       "       [ 3.53331921e-02,  5.21702780e-01],\n",
       "       [ 6.99692823e-02,  1.64920984e-01],\n",
       "       [-2.97114340e-02, -3.54245048e-02],\n",
       "       [ 7.45696136e-02,  3.18491581e-01],\n",
       "       [ 6.83084222e-03,  2.44213810e-01],\n",
       "       [-2.05510016e-02,  3.06420561e-01],\n",
       "       [ 3.29419128e-02,  1.77242766e-01],\n",
       "       [-1.78304463e-01, -1.61671275e-02],\n",
       "       [-2.50976060e-01, -4.44433499e-01],\n",
       "       [-1.14207243e-01, -3.88963063e-01],\n",
       "       [ 3.12171829e-02,  2.37167010e-01],\n",
       "       [ 1.54021000e-01,  6.14720843e-01],\n",
       "       [-1.46674512e-01, -1.88366812e-01],\n",
       "       [ 2.96222195e-02,  6.00092259e-02],\n",
       "       [-2.69651428e-01,  2.43068557e-02],\n",
       "       [-1.53484666e-01,  9.94693289e-03],\n",
       "       [ 1.69303245e-02,  2.29410241e-01],\n",
       "       [ 4.56133071e-02,  1.05691149e-01],\n",
       "       [-9.87414793e-02, -1.66171702e-02],\n",
       "       [-2.38475434e-01, -8.32042909e-02],\n",
       "       [-1.31137381e-01, -7.79963511e-02],\n",
       "       [-2.13776830e-02,  2.05394967e-01],\n",
       "       [ 2.32534844e-01,  1.25996476e-02],\n",
       "       [-5.11811717e-02, -1.05816605e-02],\n",
       "       [-2.90555728e-02, -7.60165427e-01],\n",
       "       [-1.53046739e-02, -2.96322527e-01],\n",
       "       [ 6.57720412e-02,  1.10787883e-01],\n",
       "       [-2.36790934e-01, -1.08424662e-01],\n",
       "       [-1.70633278e-04, -2.85389563e-01],\n",
       "       [-1.12371653e-01,  3.48437556e-01],\n",
       "       [-9.81266196e-02, -5.45659296e-01],\n",
       "       [-2.57191032e-01,  4.20239936e-01],\n",
       "       [-7.86746130e-02,  3.48304395e-01],\n",
       "       [ 1.10982071e-01, -4.23335418e-01],\n",
       "       [ 1.21040552e-01, -2.42440190e-01],\n",
       "       [ 7.80198444e-02,  3.76481682e-02],\n",
       "       [ 1.63061478e-01, -3.33266418e-02],\n",
       "       [ 1.40440869e-01, -2.81902882e-01],\n",
       "       [ 3.29551728e-01, -6.29029326e-01],\n",
       "       [ 2.19621263e-01, -4.79639820e-01],\n",
       "       [-1.57681907e-01, -4.41861676e-02],\n",
       "       [-3.09219573e-01, -1.33894874e-01],\n",
       "       [ 5.38460965e-02,  5.13767764e-01],\n",
       "       [-4.58247549e-02,  3.44995038e-01],\n",
       "       [ 1.85429264e-01, -2.19119324e-01],\n",
       "       [ 6.09591171e-02, -5.11855509e-01],\n",
       "       [-1.40227954e-01,  5.73182243e-01],\n",
       "       [ 1.63040977e-01,  6.45227566e-02],\n",
       "       [-6.03719696e-02, -2.86150091e-01],\n",
       "       [-2.40704986e-01,  2.05534524e-01],\n",
       "       [ 1.47503846e-01, -4.58477039e-02],\n",
       "       [ 4.02660775e-03, -2.31256463e-01],\n",
       "       [ 5.28273230e-02, -1.54180024e-01],\n",
       "       [-2.31524053e-01,  4.49530192e-01],\n",
       "       [-2.23364626e-02,  4.98898076e-01],\n",
       "       [-2.52901923e-01,  1.14548205e-01],\n",
       "       [ 1.28193066e-01, -2.08763167e-01],\n",
       "       [-1.90996358e-01,  1.53233888e-01],\n",
       "       [-5.05434412e-01,  1.72875189e-01],\n",
       "       [ 3.09828045e-01,  3.35592292e-01],\n",
       "       [ 5.55419691e-02, -7.34878937e-01],\n",
       "       [-2.21202937e-01, -1.62180236e-01],\n",
       "       [ 2.04617872e-02, -2.81835840e-01],\n",
       "       [ 2.10621786e-01, -2.72911321e-02],\n",
       "       [ 2.77653777e-01, -3.22693747e-01],\n",
       "       [ 5.05304967e-01, -1.13586596e-01],\n",
       "       [-1.53046739e-02, -2.96322527e-01],\n",
       "       [ 5.79127477e-02, -2.92569525e-01],\n",
       "       [ 2.41091000e-01, -5.04482664e-01],\n",
       "       [ 4.26195940e-01, -1.77825091e-01],\n",
       "       [ 2.54367442e-01,  1.21898172e-01],\n",
       "       [ 1.37001274e-01, -1.30481631e-01],\n",
       "       [ 4.45953047e-02, -7.23251563e-01],\n",
       "       [-1.55038628e-01, -3.62909648e-01]])"
      ]
     },
     "execution_count": 50,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "X_pac"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 51,
   "id": "227a11e2",
   "metadata": {},
   "outputs": [],
   "source": [
    "explained_variance_ratio = eig_vals / np.sum(eig_vals)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 53,
   "id": "9379646f",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([0.92461872, 0.05306648, 0.01710261, 0.00521218])"
      ]
     },
     "execution_count": 53,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "explained_variance_ratio"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 54,
   "id": "d0e885b8",
   "metadata": {
    "collapsed": true
   },
   "outputs": [
    {
     "ename": "SyntaxError",
     "evalue": "invalid syntax (2741339039.py, line 1)",
     "output_type": "error",
     "traceback": [
      "\u001b[1;36m  Cell \u001b[1;32mIn[54], line 1\u001b[1;36m\u001b[0m\n\u001b[1;33m    import sklearn.decomposition import PCA\u001b[0m\n\u001b[1;37m                                 ^\u001b[0m\n\u001b[1;31mSyntaxError\u001b[0m\u001b[1;31m:\u001b[0m invalid syntax\n"
     ]
    }
   ],
   "source": [
    "import sklearn.decomposition import PCA"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 55,
   "id": "65f656f7",
   "metadata": {},
   "outputs": [],
   "source": [
    "from sklearn.decomposition import PCA"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 56,
   "id": "4d45abc5",
   "metadata": {},
   "outputs": [],
   "source": [
    "pca = PCA(n_components=2)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 57,
   "id": "4de78bed",
   "metadata": {},
   "outputs": [],
   "source": [
    "X_pca = pca.fit_transform(X)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 59,
   "id": "7ee1742e",
   "metadata": {},
   "outputs": [
    {
     "ename": "AttributeError",
     "evalue": "'numpy.ndarray' object has no attribute 'explained_variance_ratio_'",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mAttributeError\u001b[0m                            Traceback (most recent call last)",
      "Cell \u001b[1;32mIn[59], line 1\u001b[0m\n\u001b[1;32m----> 1\u001b[0m \u001b[43mX_pca\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mexplained_variance_ratio_\u001b[49m\n",
      "\u001b[1;31mAttributeError\u001b[0m: 'numpy.ndarray' object has no attribute 'explained_variance_ratio_'"
     ]
    }
   ],
   "source": [
    "X_pca.explained_variance_ratio_"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 60,
   "id": "cfb735a6",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([0.92461872, 0.05306648])"
      ]
     },
     "execution_count": 60,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pca.explained_variance_ratio_"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 61,
   "id": "e34f82d8",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<style>#sk-container-id-1 {color: black;}#sk-container-id-1 pre{padding: 0;}#sk-container-id-1 div.sk-toggleable {background-color: white;}#sk-container-id-1 label.sk-toggleable__label {cursor: pointer;display: block;width: 100%;margin-bottom: 0;padding: 0.3em;box-sizing: border-box;text-align: center;}#sk-container-id-1 label.sk-toggleable__label-arrow:before {content: \"▸\";float: left;margin-right: 0.25em;color: #696969;}#sk-container-id-1 label.sk-toggleable__label-arrow:hover:before {color: black;}#sk-container-id-1 div.sk-estimator:hover label.sk-toggleable__label-arrow:before {color: black;}#sk-container-id-1 div.sk-toggleable__content {max-height: 0;max-width: 0;overflow: hidden;text-align: left;background-color: #f0f8ff;}#sk-container-id-1 div.sk-toggleable__content pre {margin: 0.2em;color: black;border-radius: 0.25em;background-color: #f0f8ff;}#sk-container-id-1 input.sk-toggleable__control:checked~div.sk-toggleable__content {max-height: 200px;max-width: 100%;overflow: auto;}#sk-container-id-1 input.sk-toggleable__control:checked~label.sk-toggleable__label-arrow:before {content: \"▾\";}#sk-container-id-1 div.sk-estimator input.sk-toggleable__control:checked~label.sk-toggleable__label {background-color: #d4ebff;}#sk-container-id-1 div.sk-label input.sk-toggleable__control:checked~label.sk-toggleable__label {background-color: #d4ebff;}#sk-container-id-1 input.sk-hidden--visually {border: 0;clip: rect(1px 1px 1px 1px);clip: rect(1px, 1px, 1px, 1px);height: 1px;margin: -1px;overflow: hidden;padding: 0;position: absolute;width: 1px;}#sk-container-id-1 div.sk-estimator {font-family: monospace;background-color: #f0f8ff;border: 1px dotted black;border-radius: 0.25em;box-sizing: border-box;margin-bottom: 0.5em;}#sk-container-id-1 div.sk-estimator:hover {background-color: #d4ebff;}#sk-container-id-1 div.sk-parallel-item::after {content: \"\";width: 100%;border-bottom: 1px solid gray;flex-grow: 1;}#sk-container-id-1 div.sk-label:hover label.sk-toggleable__label {background-color: #d4ebff;}#sk-container-id-1 div.sk-serial::before {content: \"\";position: absolute;border-left: 1px solid gray;box-sizing: border-box;top: 0;bottom: 0;left: 50%;z-index: 0;}#sk-container-id-1 div.sk-serial {display: flex;flex-direction: column;align-items: center;background-color: white;padding-right: 0.2em;padding-left: 0.2em;position: relative;}#sk-container-id-1 div.sk-item {position: relative;z-index: 1;}#sk-container-id-1 div.sk-parallel {display: flex;align-items: stretch;justify-content: center;background-color: white;position: relative;}#sk-container-id-1 div.sk-item::before, #sk-container-id-1 div.sk-parallel-item::before {content: \"\";position: absolute;border-left: 1px solid gray;box-sizing: border-box;top: 0;bottom: 0;left: 50%;z-index: -1;}#sk-container-id-1 div.sk-parallel-item {display: flex;flex-direction: column;z-index: 1;position: relative;background-color: white;}#sk-container-id-1 div.sk-parallel-item:first-child::after {align-self: flex-end;width: 50%;}#sk-container-id-1 div.sk-parallel-item:last-child::after {align-self: flex-start;width: 50%;}#sk-container-id-1 div.sk-parallel-item:only-child::after {width: 0;}#sk-container-id-1 div.sk-dashed-wrapped {border: 1px dashed gray;margin: 0 0.4em 0.5em 0.4em;box-sizing: border-box;padding-bottom: 0.4em;background-color: white;}#sk-container-id-1 div.sk-label label {font-family: monospace;font-weight: bold;display: inline-block;line-height: 1.2em;}#sk-container-id-1 div.sk-label-container {text-align: center;}#sk-container-id-1 div.sk-container {/* jupyter's `normalize.less` sets `[hidden] { display: none; }` but bootstrap.min.css set `[hidden] { display: none !important; }` so we also need the `!important` here to be able to override the default hidden behavior on the sphinx rendered scikit-learn.org. See: https://github.com/scikit-learn/scikit-learn/issues/21755 */display: inline-block !important;position: relative;}#sk-container-id-1 div.sk-text-repr-fallback {display: none;}</style><div id=\"sk-container-id-1\" class=\"sk-top-container\"><div class=\"sk-text-repr-fallback\"><pre>PCA(n_components=2)</pre><b>In a Jupyter environment, please rerun this cell to show the HTML representation or trust the notebook. <br />On GitHub, the HTML representation is unable to render, please try loading this page with nbviewer.org.</b></div><div class=\"sk-container\" hidden><div class=\"sk-item\"><div class=\"sk-estimator sk-toggleable\"><input class=\"sk-toggleable__control sk-hidden--visually\" id=\"sk-estimator-id-1\" type=\"checkbox\" checked><label for=\"sk-estimator-id-1\" class=\"sk-toggleable__label sk-toggleable__label-arrow\">PCA</label><div class=\"sk-toggleable__content\"><pre>PCA(n_components=2)</pre></div></div></div></div></div>"
      ],
      "text/plain": [
       "PCA(n_components=2)"
      ]
     },
     "execution_count": 61,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pca"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 62,
   "id": "aace05b8",
   "metadata": {},
   "outputs": [],
   "source": [
    "pca = PCA(n_components=3)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 63,
   "id": "6f161c9c",
   "metadata": {
    "collapsed": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[ 2.26243707e-03,  2.79148276e-02],\n",
       "       [ 9.90265503e-02,  2.10464272e-01],\n",
       "       [ 1.99683897e-02, -1.79002563e-02],\n",
       "       [-7.55758166e-02, -3.15593736e-02],\n",
       "       [-6.12585926e-02, -9.00792406e-02],\n",
       "       [-2.42008576e-02, -1.68677658e-01],\n",
       "       [-4.81431065e-02, -2.57892158e-01],\n",
       "       [-4.52978706e-02,  2.18793179e-02],\n",
       "       [-2.67447358e-02, -2.07595703e-02],\n",
       "       [-5.62954013e-02,  1.97632725e-01],\n",
       "       [-1.50199245e-02,  7.53180094e-02],\n",
       "       [-1.56379208e-01, -1.02150260e-01],\n",
       "       [-7.88791149e-03,  2.06844430e-01],\n",
       "       [-2.16798118e-02, -6.12996725e-02],\n",
       "       [ 1.59209718e-01,  1.51627524e-01],\n",
       "       [ 6.55154587e-03, -2.77776903e-01],\n",
       "       [ 1.67734737e-01, -1.38183228e-01],\n",
       "       [ 7.76281796e-02, -2.66683156e-02],\n",
       "       [ 2.70518681e-02,  1.20305523e-01],\n",
       "       [-6.62726502e-02, -2.13665172e-01],\n",
       "       [-1.50707908e-02,  2.39444043e-01],\n",
       "       [ 4.10654027e-02, -2.08457232e-01],\n",
       "       [ 4.48212505e-03, -2.92396751e-01],\n",
       "       [ 1.48352589e-01, -3.91232587e-02],\n",
       "       [-3.00330904e-01, -1.25021083e-01],\n",
       "       [ 3.46074722e-02,  2.53420042e-01],\n",
       "       [ 5.74497158e-02, -9.49105761e-02],\n",
       "       [-1.41727423e-02,  7.84942051e-02],\n",
       "       [ 6.57834667e-02,  1.45908896e-01],\n",
       "       [-1.23983306e-01, -4.07710791e-02],\n",
       "       [-6.04622767e-02,  7.72229891e-02],\n",
       "       [ 2.31628492e-01,  1.45524972e-01],\n",
       "       [-2.81372347e-01, -2.25669150e-01],\n",
       "       [-9.53488583e-02, -1.57810813e-01],\n",
       "       [ 1.90703413e-02,  1.43049582e-01],\n",
       "       [ 1.62598446e-01,  1.64332307e-01],\n",
       "       [ 1.76441213e-01,  2.68350376e-01],\n",
       "       [-1.68173054e-01, -9.36990825e-02],\n",
       "       [-1.07331474e-02, -7.29270457e-02],\n",
       "       [-1.37491513e-02,  8.00823030e-02],\n",
       "       [ 9.40633590e-02, -7.72476932e-02],\n",
       "       [ 3.19987487e-01,  3.49230377e-01],\n",
       "       [-7.46777682e-02, -1.92509212e-01],\n",
       "       [ 1.76208890e-01, -2.63867946e-01],\n",
       "       [-1.82842502e-01, -2.98742746e-01],\n",
       "       [ 1.42843574e-01,  9.76781440e-02],\n",
       "       [-1.89622291e-01, -1.66705637e-01],\n",
       "       [-5.95642283e-02, -8.37268490e-02],\n",
       "       [-4.65686438e-02,  1.71150242e-02],\n",
       "       [ 3.46583385e-02,  8.92940085e-02],\n",
       "       [ 1.85252879e-02,  4.06568025e-01],\n",
       "       [ 5.66512106e-04,  1.80141866e-02],\n",
       "       [-1.65317587e-03,  3.38325765e-01],\n",
       "       [ 9.35668402e-02,  1.79591392e-01],\n",
       "       [ 1.12020574e-01,  3.07757896e-01],\n",
       "       [-2.43116767e-01, -4.10760908e-02],\n",
       "       [-8.35565724e-02, -1.69810240e-01],\n",
       "       [-1.79077226e-02, -1.23029192e-02],\n",
       "       [-3.91345020e-02,  4.15336085e-01],\n",
       "       [-5.61891788e-03, -2.81141431e-01],\n",
       "       [ 4.55624408e-02,  2.69817183e-01],\n",
       "       [ 5.07192325e-02, -1.30547750e-01],\n",
       "       [ 5.71855195e-02,  6.94146830e-01],\n",
       "       [-1.69496255e-01,  6.21144083e-02],\n",
       "       [ 1.25217292e-01, -9.04576907e-02],\n",
       "       [ 9.98031365e-02,  3.14620976e-01],\n",
       "       [-1.87878621e-01, -3.28027528e-01],\n",
       "       [-2.13757370e-01,  2.71161837e-01],\n",
       "       [ 2.57192177e-01,  4.99519046e-01],\n",
       "       [-4.15766476e-02,  2.35002105e-01],\n",
       "       [-7.50315529e-02, -4.59620991e-01],\n",
       "       [ 1.22997604e-01,  2.29853888e-01],\n",
       "       [ 8.88370584e-04,  3.47854352e-01],\n",
       "       [-2.88255429e-01,  2.31071778e-01],\n",
       "       [ 4.17197556e-02,  3.21800937e-01],\n",
       "       [ 1.00226728e-01,  3.16209074e-01],\n",
       "       [ 3.53331921e-02,  5.21702780e-01],\n",
       "       [ 6.99692823e-02,  1.64920984e-01],\n",
       "       [-2.97114340e-02, -3.54245048e-02],\n",
       "       [ 7.45696136e-02,  3.18491581e-01],\n",
       "       [ 6.83084222e-03,  2.44213810e-01],\n",
       "       [-2.05510016e-02,  3.06420561e-01],\n",
       "       [ 3.29419128e-02,  1.77242766e-01],\n",
       "       [-1.78304463e-01, -1.61671275e-02],\n",
       "       [-2.50976060e-01, -4.44433499e-01],\n",
       "       [-1.14207243e-01, -3.88963063e-01],\n",
       "       [ 3.12171829e-02,  2.37167010e-01],\n",
       "       [ 1.54021000e-01,  6.14720843e-01],\n",
       "       [-1.46674512e-01, -1.88366812e-01],\n",
       "       [ 2.96222195e-02,  6.00092259e-02],\n",
       "       [-2.69651428e-01,  2.43068557e-02],\n",
       "       [-1.53484666e-01,  9.94693289e-03],\n",
       "       [ 1.69303245e-02,  2.29410241e-01],\n",
       "       [ 4.56133071e-02,  1.05691149e-01],\n",
       "       [-9.87414793e-02, -1.66171702e-02],\n",
       "       [-2.38475434e-01, -8.32042909e-02],\n",
       "       [-1.31137381e-01, -7.79963511e-02],\n",
       "       [-2.13776830e-02,  2.05394967e-01],\n",
       "       [ 2.32534844e-01,  1.25996476e-02],\n",
       "       [-5.11811717e-02, -1.05816605e-02],\n",
       "       [-2.90555728e-02, -7.60165427e-01],\n",
       "       [-1.53046739e-02, -2.96322527e-01],\n",
       "       [ 6.57720412e-02,  1.10787883e-01],\n",
       "       [-2.36790934e-01, -1.08424662e-01],\n",
       "       [-1.70633278e-04, -2.85389563e-01],\n",
       "       [-1.12371653e-01,  3.48437556e-01],\n",
       "       [-9.81266196e-02, -5.45659296e-01],\n",
       "       [-2.57191032e-01,  4.20239936e-01],\n",
       "       [-7.86746130e-02,  3.48304395e-01],\n",
       "       [ 1.10982071e-01, -4.23335418e-01],\n",
       "       [ 1.21040552e-01, -2.42440190e-01],\n",
       "       [ 7.80198444e-02,  3.76481682e-02],\n",
       "       [ 1.63061478e-01, -3.33266418e-02],\n",
       "       [ 1.40440869e-01, -2.81902882e-01],\n",
       "       [ 3.29551728e-01, -6.29029326e-01],\n",
       "       [ 2.19621263e-01, -4.79639820e-01],\n",
       "       [-1.57681907e-01, -4.41861676e-02],\n",
       "       [-3.09219573e-01, -1.33894874e-01],\n",
       "       [ 5.38460965e-02,  5.13767764e-01],\n",
       "       [-4.58247549e-02,  3.44995038e-01],\n",
       "       [ 1.85429264e-01, -2.19119324e-01],\n",
       "       [ 6.09591171e-02, -5.11855509e-01],\n",
       "       [-1.40227954e-01,  5.73182243e-01],\n",
       "       [ 1.63040977e-01,  6.45227566e-02],\n",
       "       [-6.03719696e-02, -2.86150091e-01],\n",
       "       [-2.40704986e-01,  2.05534524e-01],\n",
       "       [ 1.47503846e-01, -4.58477039e-02],\n",
       "       [ 4.02660775e-03, -2.31256463e-01],\n",
       "       [ 5.28273230e-02, -1.54180024e-01],\n",
       "       [-2.31524053e-01,  4.49530192e-01],\n",
       "       [-2.23364626e-02,  4.98898076e-01],\n",
       "       [-2.52901923e-01,  1.14548205e-01],\n",
       "       [ 1.28193066e-01, -2.08763167e-01],\n",
       "       [-1.90996358e-01,  1.53233888e-01],\n",
       "       [-5.05434412e-01,  1.72875189e-01],\n",
       "       [ 3.09828045e-01,  3.35592292e-01],\n",
       "       [ 5.55419691e-02, -7.34878937e-01],\n",
       "       [-2.21202937e-01, -1.62180236e-01],\n",
       "       [ 2.04617872e-02, -2.81835840e-01],\n",
       "       [ 2.10621786e-01, -2.72911321e-02],\n",
       "       [ 2.77653777e-01, -3.22693747e-01],\n",
       "       [ 5.05304967e-01, -1.13586596e-01],\n",
       "       [-1.53046739e-02, -2.96322527e-01],\n",
       "       [ 5.79127477e-02, -2.92569525e-01],\n",
       "       [ 2.41091000e-01, -5.04482664e-01],\n",
       "       [ 4.26195940e-01, -1.77825091e-01],\n",
       "       [ 2.54367442e-01,  1.21898172e-01],\n",
       "       [ 1.37001274e-01, -1.30481631e-01],\n",
       "       [ 4.45953047e-02, -7.23251563e-01],\n",
       "       [-1.55038628e-01, -3.62909648e-01]])"
      ]
     },
     "execution_count": 63,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "X_pac"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "024050ab",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "a1fce66e",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "3acf04ed",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.20"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
